📌  相关文章
📜  错误:要么使用 --sdk_root= 明确指定它,要么将此包移动到其预期位置:<sdk> cmdline-tools latest - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:24.441000             🧑  作者: Mango

代码示例1
This appears to be a bug with the way sdkmanager locates the SDK installation folder.

A work-around is to set the flag --sdk_root. You can move ANDROID_HOME declaration higher, then use it with the subsequent commands.

 - export ANDROID_HOME=$PWD/android-sdk-linux
 - yes | android-sdk-linux/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --licenses
 - android-sdk-linux/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} "platform-tools" "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
Also, moved blanket license acceptance command to the first command to clean up the echo y parts.

Oddly enough if you run sdkmanager --sdk_root=${ANDROID_HOME} "tools" it will upgrade tools from 3.6.0 to 26.1.1 and sdkmanager no longer has this issue. This update takes time and bandwidth and isn't exactly necessary with the work-around.