appbuild.gradle文件中
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:29.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}修改为

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

如果出现Dex file with version '38' cannot be used with min sdk level '29'.类似的错误
修改同文件下
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.z.test1"
minSdkVersion 29
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
降低版本,我这边写为15
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.z.test1"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}


相关文章:

  • 2021-12-31
  • 2022-02-11
  • 2021-11-01
  • 2021-11-24
  • 2022-01-08
  • 2021-08-08
  • 2021-11-27
  • 2021-07-16
猜你喜欢
  • 2021-05-08
  • 2021-10-14
  • 2022-01-17
  • 2021-04-29
  • 2021-08-10
相关资源
相似解决方案