Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

新建android项目后,第一次运行,提示错误:(不一定是31的也可能是其他版本,个人已解决问题)
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
mac 系统
/Users/{自己电脑名称}/Library/Android/sdk/build-tools/31.0.0,在此文件夹下有个d8文件,lib文件夹,lib文件夹下有d8.jar
打开终端:

cd /Users/xxx/Library/Android/sdk/build-tools/31.0.0
cp d8 dx
cd lib
cp d8.jar dx.jar

重新运行项目安装即可

你可能感兴趣的:(Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.)