假设报错如下(以30.0.3为例)
首先,尝试在build.gradle中添加sdk的版本
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "org.tensorflow.lite.examples.digitclassifier"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
如果还不行,可以尝试下面这种,亲测可用。
打开SDK Manager,找到“SDK Tools”,然后右下角选中“Show Package Details”,然后按图操作“29.02”,“Apply”即可。
参见:
java - Failed to find build tools revision 29.0.2 - Android Studio - Stack Overflow
Failed to find Build Tools revision 29.0.1 - 知乎
android - Failed to find Build Tools revision 23.0.1 - Stack Overflow