无法使用Java 8运行./sdkmanager -list

时间:2019-01-09 15:42:07

标签: android-studio unity3d

当前在我的Mac (java version "1.8.0_191")上安装了Java 8.0,并试图按照instructions provided by Unity 安装Android SDK的命令行工具。

当我第一次运行./sdkmanager时,遇到错误.android/repositories.cfg could not be loaded.,该错误是根据这里的答案通过创建错误而修复的:Stuck at ".android/repositories.cfg could not be loaded."

现在,当再次运行./sdkmanager命令时,出现以下错误,我似乎无法找到针对以下问题的修复:Warning: Failed to find package -list

我尝试再次下载工具并重新开始,但无济于事。升级到Java 11只是返回了更多与Java EE模块相关的错误。

我有什么选择?如何解决此错误?

编辑1:我手动删除了所有内容,并决定使用以下命令安装命令行工具:wget https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip。到目前为止,解压缩文件并运行tools/bin/sdkmanager --update似乎可以正常工作。

编辑2:仍然出现错误File /Users/cyril/.android/repositories.cfg could not be loaded.

1 个答案:

答案 0 :(得分:0)

Why not install Android Studio? Everything needed to run and use the Android command line tools is part of Android Studio, as well as a way to keep the tools updated. Since Unity3d 2018.3 version, by default, Unity installs a Java Development Kit based on OpenJDK.

Also, based on this official reference:

A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.