【发布时间】:2019-11-12 01:36:32
【问题描述】:
从未真正使用过会引发如此多错误的软件。我安装并得到了以下所有错误,因此尝试全新安装,然后重新安装过程以完全删除它,甚至包括 SDK,但再次安装它会引发完全相同的错误。根据我的阅读,它应该在基本安装后才能工作?
第一次打开时的第一个错误:
unable to access android sdk add on list
即使在安装后我添加了它并在我的防火墙中批准了它。
然后在安装过程中,它说 HAXM 安装失败,并给出了一个安装链接,这是一个找不到的页面。然后我在 SDK 管理器中的工具下发现它显示Intel x86 Emulator Accelerator (HAXM installer) 7.3.2 - Installed。根据我的阅读,这意味着它已安装?
我正在使用 MacOS High Sierra,应该去 System Preferences > Security & Privacy 并选择允许这个特定的应用程序应该修复它,但因为我已经将它设置为允许 任何明显无法为我解决问题的应用程序。
然后我添加了 Flutter 插件,创建了默认应用并启动它,我得到了错误:
* 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.
它在此错误输出中说我需要接受 SDK 许可协议,但不确定如何或为什么需要这样做。我遵循的教程不需要这样做任何...不知道为什么它这么奇怪。
编辑:错误标记为重复。这不是重复的,因为 3 年前的解决方案对我不起作用,而且我还有另外两个错误,在重复的问题中根本没有提到。
此外,我的问题的解决方案是删除 Homebrew 安装的 Android SDK 的第二次安装。在假定的问题中没有提到这些,这是一个“重复”。
【问题讨论】:
-
@Lakhwinder Singh 您链接到自己的那个问题是重复的,也没有公认的答案。它也是3岁。更不用说在我的情况下它是一个全新的安装并且不应该需要这样的方法来修复它。我的问题是为什么在全新安装后它不能立即工作。这也只是指我遇到的一个错误......
-
@Lakhwinder Singh 尝试过
yes | sudo ~/Library/Android/sdk/tools/bin/sdkmanager --licenses,但它不起作用,它仍然会抛出与上述相同的错误。可能是由于我列出的其他错误。 -
上面写着
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager,但我找不到怎么做... -
@Lakhwinder Singh 您能否删除您的重复标记,因为 1. 您从 3 年前链接到的问题中的解决方案不起作用。它返回
Warning: File /var/root/.android/repositories.cfg could not be loaded. All SDK package licenses accepted.======] 100% Computing updates...我什至尝试再次运行它,重新启动但它根本无法修复错误。 2.它与我遇到的HAXM问题无关,也与unable to access android sdk add on list错误无关。
标签: android android-studio gradle