【问题标题】:Android gradle - After update multiple errors showed upAndroid gradle - 更新后出现多个错误
【发布时间】:2017-12-14 19:54:29
【问题描述】:

我在这方面花了几天时间,每次我修复 Android 的错误时都会出现两个新错误。

我在一个 Cordova 项目中工作,在我将我的 andrid SDK 更新到 API 26 后停止工作,gradle 总是失败。

SDK 管理器

我的 build.gradle:

apply plugin: 'com.android.application'

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }

    // Switch the Android Gradle plugin version requirement depending on the
    // installed version of Gradle. This dependency is documented at
    // http://tools.android.com/tech-docs/new-build-system/version-compatibility
    // and https://issues.apache.org/jira/browse/CB-8143
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.1'
    }
}

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        mavenCentral();
        jcenter()
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.14.1'
}

非常感谢任何帮助

【问题讨论】:

  • 您必须在您的项目中使用这些库依赖项。这些库的构建工具版本和依赖版本应该保持不变以避免任何冲突。要么将这些依赖项降级到 26.1.0,要么将构建工具版本更新到 27,目前似乎只更新到 26 版本。

标签: android cordova gradle android-gradle-plugin


【解决方案1】:

与 Android 8.0 兼容的最新支持库需要 Google 的新 Maven repo

将此添加到您的代码中:

repositories {
    google()

    // If you're using a version of Gradle lower than 4.1, you must instead use:
    // maven {
    //     url 'https://maven.google.com'
    // }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-11
    • 2017-08-10
    • 1970-01-01
    • 2016-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多