java - 更新 Android Studio Canary beta 1 后。我收到错误 min sdk 26

标签 java android android-studio

我的 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
}

最佳答案

您可以尝试将其升级到最新的 Android 特定版本

implementation 'com.google.guava:guava:23.0-android'

这为我解决了错误

关于java - 更新 Android Studio Canary beta 1 后。我收到错误 min sdk 26,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45619025/

相关文章:

android - Gradle构建时间太长

java - 在数据库中插入 clob 数据或所有类型的文件存储

java - 获取已安装在 OSGi 运行时中的 bundle 的 InputStream?

java - 如何编译一个任意命名与公共(public)类名不同的.java文件

java - Android Studio 上使用 OpenCV 库的多个 dex 文件

android-studio - 删除我的 Android 应用程序中的夜间模式 |安卓工作室

java - 使用 Java ImageIO 或 Imagemagick 将 DCI-P3 色彩空间转换为 sRGB

java - Android 中无法使用 JAVA 解决异常处理程序?

java - Java 模块中的 BuildConfig 等价物是什么? - 安卓

android - 如何正确地将库模块依赖项添加到 Flutter Plugin 的 Android 文件夹中?