引
公司需要在发布网站搭建一套gradle编译环境
过程
1.下载 gradle 官网地址:https://gradle.org 下载完整包 不要下载bin包
2.上传至编译服务器,解压配置环境变量 ok.
3.部署安卓环境,emmm 市面上教程都是r24 ,so官网找,官网地址:https://developer.android.google.cn/
4.找到工具Command line tools 位置:https://developer.android.google.cn/studio#downloads 页面拉到底部
5.下载解压上传 使用时报错
Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
6.各种试无果,寻求答案
7.最终stackOverFlow找到解决办法。
地址:https://stackoverflow.com/questions/60440509/android-command-line-tools-sdkmanager-always-shows-warning-could-not-create-se
大致意思就是这个玩意对父目录的名字有要求,认爸爸。
父目录必须为:cmdline-tools
8.将环境变量更改为:
export ANDROID_HOME=/usr/local/Android
export PATH=$PATH$:$ANDROID_HOME/cmdline-tools/tools/bin
9.运行./sdkmanager --list
成功显示内容
[=======================================] 100% Computing updates...
Available Packages:
Path | Version | Description
------- | ------- | -------
add-ons;addon-google_apis-google-15 | 3 | Google APIs
add-ons;addon-google_apis-google-16 | 4 | Google APIs
add-ons;addon-google_apis-google-17 | 4 | Google APIs
add-ons;addon-google_apis-google-18 | 4 | Google APIs
add-ons;addon-google_apis-google-19 | 20 | Google APIs
add-ons;addon-google_apis-google-21 | 1 | Google APIs
add-ons;addon-google_apis-google-22 | 1 | Google APIs
add-ons;addon-google_apis-google-23 | 1 | Google APIs
add-ons;addon-google_apis-google-24 | 1 | Google APIs
build-tools;19.1.0 | 19.1.0 | Android SDK Build-Tools 19.1
build-tools;20.0.0 | 20.0.0 | Android SDK Build-Tools 20
build-tools;21.1.2 | 21.1.2 | Android SDK Build-Tools 21.1.2
build-tools;22.0.1 | 22.0.1 | Android SDK Build-Tools 22.0.1
build-tools;23.0.1 | 23.0.1 | Android SDK Build-Tools 23.0.1
build-tools;23.0.2 | 23.0.2 | Android SDK Build-Tools 23.0.2
build-tools;23.0.3 | 23.0.3 | Android SDK Build-Tools 23.0.3
build-tools;24.0.0 | 24.0.0 | Android SDK Build-Tools 24
build-tools;24.0.1 | 24.0.1 | Android SDK Build-Tools 24.0.1
build-tools;24.0.2 | 24.0.2 | Android SDK Build-Tools 24.0.2
build-tools;24.0.3 | 24.0.3 | Android SDK Build-Tools 24.0.3
build-tools;25.0.0 | 25.0.0 | Android SDK Build-Tools 25
build-tools;25.0.1 | 25.0.1 | Android SDK Build-Tools 25.0.1
build-tools;25.0.2 | 25.0.2 | Android SDK Build-Tools 25.0.2
build-tools;25.0.3 | 25.0.3 | Android SDK Build-Tools 25.0.3
build-tools;26.0.0 | 26.0.0 | Android SDK Build-Tools 26
build-tools;26.0.1 | 26.0.1 | Android SDK Build-Tools 26.0.1
build-tools;26.0.2 | 26.0.2 | Android SDK Build-Tools 26.0.2
build-tools;26.0.3 | 26.0.3 | Android SDK Build-Tools 26.0.3
build-tools;27.0.0 | 27.0.0 | Android SDK Build-Tools 27
build-tools;27.0.1 | 27.0.1 | Android SDK Build-Tools 27.0.1
build-tools;27.0.2 | 27.0.2 | Android SDK Build-Tools 27.0.2
build-tools;27.0.3 | 27.0.3 | Android SDK Build-Tools 27.0.3
build-tools;28.0.0 | 28.0.0 | Android SDK Build-Tools 28
build-tools;28.0.1 | 28.0.1 | Android SDK Build-Tools 28.0.1
build-tools;28.0.2 | 28.0.2 | Android SDK Build-Tools 28.0.2
build-tools;28.0.3 | 28.0.3 | Android SDK Build-Tools 28.0.3
build-tools;29.0.0 | 29.0.0 | Android SDK Build-Tools 29
build-tools;29.0.1 | 29.0.1 | Android SDK Build-Tools 29.0.1
build-tools;29.0.2 | 29.0.2 | Android SDK Build-Tools 29.0.2
build-tools;29.0.3 | 29.0.3 | Android SDK Build-Tools 29.0.3
build-tools;30.0.0 | 30.0.0 | Android SDK Build-Tools 30
build-tools;30.0.1 | 30.0.1 | Android SDK Build-Tools 30.0.1
尾
结束,感谢前辈们趟过的坑并分享经验。