跳到主要内容

更新 Android targetSdkVersion

如果业务项目中用的 Android Gradle 插件是 7.x 或之后的版本,则无需修改。

Build Tools revision 33.0.0​

如果编译工程时提示 Installed Build Tools revision 33.0.0 is corrupted. Remove and install again using the SDK Manager.,则需要将 AndroidSDK 所在目录下 build-tools/33.0.0 下的 d8 改为 dx。可以执行如下命令:

MAC

cd {YOUR_ANDROID_SDK_HOME}/build-tools/33.0.0
cp d8 dx
cd lib
cp d8.jar dx.jar

Windows

cd {YOUR_ANDROID_SDK_HOME}/build-tools/33.0.0
xcopy d8 dx
cd lib
xcopy d8.dat dx.dat

Build Tools revision 32.0.0​

如果编译工程时提示 Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager.,则需要将 AndroidSDK 所在目录下 build-tools/32.0.0 下的 d8 改为 dx,执行如下命令:

MAC

cd {YOUR_ANDROID_SDK_HOME}/build-tools/32.0.0
cp d8 dx
cd lib
cp d8.jar dx.jar

Windows

cd {YOUR_ANDROID_SDK_HOME}/build-tools/32.0.0
xcopy d8 dx
cd lib
xcopy d8.dat dx.dat

Build Tools revision 31.0.0​

如果编译工程时提示 Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.,则需要将 AndroidSDK 所在目录下 build-tools/31.0.0 下的 d8 改为 dx。可以执行如下命令:

MAC

cd {YOUR_ANDROID_SDK_HOME}/build-tools/31.0.0
cp d8 dx
cd lib
cp d8.jar dx.jar

Windows

cd {YOUR_ANDROID_SDK_HOME}/build-tools/31.0.0
xcopy d8 dx
cd lib
xcopy d8.dat dx.dat