Monday, 11 July 2016

Android Studio Mac Fresh install - error after error after error

Never really used a piece of software that threw so many errors. I installed and got all the errors below so tried a fresh install, following a reinstall process to remove it completely, even including the SDKs but installing it again threw the exact same errors. From what I read it should just work after the basic install?



First error on opening it for the first time:



unable to access android sdk add on list




Even though right after installing I added it and approved it in my firewall.



Then during install it says HAXM failed to install, and it gives a link to install it which is a page not found. Then I found in the SDK Manager under tools it shows Intel x86 Emulator Accelerator (HAXM installer) 7.3.2 - Installed. From what I read that means it IS installed?



I'm using MacOS High Sierra and supposedly going to System Preferences > Security & Privacy and opting to allow this particular app should fix it, but since I already have it set to allow any apps that clearly doesn't fix it for me.



Then I added the Flutter plugin, created the default app and launched it and I got the error:



* Error running Gradle:
ProcessException: Process "/Users/hasen/AndroidStudioProjects/testing_app/android/gradlew" exited abnormally:

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :app
Checking the license for package Android SDK Build-Tools 28.0.3 in /usr/local/Cellar/android-sdk/24.4.1_1/licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in /usr/local/Cellar/android-sdk/24.4.1_1/licenses
Warning: License for package Android SDK Platform 28 not accepted.

Picked up _JAVA_OPTIONS: -Xverify:none


FAILURE: Build failed with an exception.

* Where:
Build file '/Users/hasen/AndroidStudioProjects/testing_app/android/build.gradle' line: 24

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3

platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: /usr/local/Cellar/android-sdk/24.4.1_1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org


BUILD FAILED in 13s
Command: /Users/hasen/AndroidStudioProjects/testing_app/android/gradlew app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.


It says in this error output that I need to accept the SDK licence agreements but not sure how or why that needs to be done. The tutorials I followed didn't need to do any of this...not sure why it's so weird.



EDIT: Marked in error as a duplicate. It's not a duplicate because the solution from 3 years back does not work for me and I have two other errors which are not mentioned at all in the duplicate question.




In addition the solution to my problem was to remove the second installation of the Android SDK that was installed by Homebrew. None of this is mentioned in the supposed question this is a 'duplicate' of.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...