我的Gradle
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
}
答案 0 :(得分:1)
您可以尝试将其升级到最新的特定于Android的版本
git credentialsId: 'x', url: 'http://x.git'
这为我解决了错误
答案 1 :(得分:0)
我22日改变了番石榴21。 并添加 force' com.google.code.findbugs:jsr305:1.3.9'
这很有效。所有thx))