![](/img/trans.png)
[英]Gradle build failed after updating android studio to 4.2 Beta1
[英]After updating Android Studio Canary beta 1. I get the error min sdk 26
我的摇篮
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "com.tester.us_site"
minSdkVersion 17
//noinspection GradleCompatible
targetSdkVersion 26
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
编译后,出现此错误
Information:Gradle tasks [:app:assembleDebug]
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.code.SimException: default or static interface method used without --min-sdk-version >= 24
Information:BUILD FAILED in 40s
Information:1 error
Information:0 warnings
Information:See complete output in console
据我了解,此错误表示,要运行项目,必须指定min sdk 26。
但是Android 5.0 6.0 7.0呢?
## Gradle Build ##
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
您可以尝试将其升级到最新的Android特定版本
implementation 'com.google.guava:guava:23.0-android'
这为我修复了错误
我在22上更改了Guava 21并添加了强制'com.google.code.findbugs:jsr305:1.3.9'
可以了 所有thx))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.