Quantcast
Channel: polygun2000的博客
Viewing all articles
Browse latest Browse all 55

sdkmanager报错Couldnotcreatesettings问题

$
0
0
给andorid的开发机重新打了一个image,原来的sdk-tools已经变成了cmdline-tools,容器起来以后发现sdkmanager报错如下:
Warning: Could not create settings
java.lang.IllegalArgumentException
    at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.(SdkManagerCliSettings.
    at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.
    at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.

按命令行的提示,可以加入--sdk_root=${ANDROID_HOME},但是觉得不爽,翻了翻网上资源,发现stackoverflow有个讨论下边的评论解决了问题。

解决方法就是,cmdline-tools解压后得到的tools目录,要改名为latest,并且上级目录名是cmdline-tools

即 ANDROID_HOME = android_sdk/cmdline-tools/latest



这个解法着实有点黑盒的意思,也不知道为什么,也没有查到文档提及。

参考文档:
https:||stackoverflow.com/questions/60440509/android-command-line-tools-sdkmanager-always-shows-warning-could-not-create-se


 

Viewing all articles
Browse latest Browse all 55

Trending Articles