错误:Android Gradle插件仅支持Kotlin Gradle插件1.3.0及更高版本 [英] ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher

查看:110
本文介绍了错误:Android Gradle插件仅支持Kotlin Gradle插件1.3.0及更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问如何解决此错误?

please how can I solve this error ?

错误:Android Gradle插件仅支持Kotlin Gradle插件 1.3.0及更高版本.以下依赖项不满足 所需版本:根项目'android'-> org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.6受影响的模块: android-app

ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher. The following dependencies do not satisfy the required version: root project 'android' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.6 Affected Modules: android-app

警告:配置编译"已过时,已被替换 与实施"和"API".它将在 2018年.有关更多信息,请参见: http://d.android.com/r/tools/update-dependency-configurations.html 受影响的模块:android-app

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: android-app

警告:配置"testCompile"已过时,已被替换 与"testImplementation".它将在2018年底删除. 更多信息请参见: http://d.android.com/r/tools/update-dependency -configurations.html 受影响的模块:android-app

WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: android-app

警告:配置'androidTestCompile'已过时,并且已经 替换为"androidTestImplementation".它将在 于2018年底.有关更多信息,请参阅: http://d.android.com/r/tools/update-dependency -configurations.html 受影响的模块:android-app

WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: android-app

警告:指定的Android SDK Build Tools版本(26.0.2)为 被忽略,因为它低于最低支持的版本(28.0.3) Android Gradle插件3.3.1. Android SDK Build Tools 28.0.3将 用过的.要取消显示此警告,请删除"buildToolsVersion '26 .0.2'" 从您的build.gradle文件中,作为每个版本的Android Gradle 插件现在具有构建工具的默认版本.删除构建 工具版本和同步项目受影响的模块:android-app

WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1. Android SDK Build Tools 28.0.3 will be used. To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools. Remove Build Tools version and sync project Affected Modules: android-app

我的android-app文件:

my android-app file :

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "fr.curie.jonquille.jonquille_curie"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 203000
        versionName "2.3.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.android.support:support-v4:26.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.android.support:design:26.0.1'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile 'io.reactivex:rxandroid:1.2.1'
    compile 'io.reactivex:rxjava:1.2.4'
    compile 'io.reactivex:rxkotlin:0.60.0'
    compile 'com.jakewharton.rxbinding:rxbinding-kotlin:1.0.0'
    compile 'com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:1.0.0'
    compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:1.0.0'
    compile 'com.jakewharton.rxbinding:rxbinding-design-kotlin:1.0.0'
    compile 'com.jakewharton.rxbinding:rxbinding-recyclerview-v7-kotlin:1.0.0'
    compile 'com.tbruyelle.rxpermissions:rxpermissions:0.9.1@aar'
    compile 'pl.charmas.android:android-reactive-location:0.10@aar'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.sdoward:rxgooglemaps:1.1.1@aar'
    compile 'com.github.kittinunf.fuel:fuel:1.3.1'
    compile 'com.github.kittinunf.fuel:fuel-android:1.3.1'
    compile 'com.github.kittinunf.fuel:fuel-rxjava:1.3.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services-wallet:10.0.1'
    compile 'com.stripe:stripe-android:2.0.2'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.twitter.sdk.android:twitter-core:3.1.1'
    compile 'com.twitter.sdk.android:tweet-composer:3.1.1'
    testCompile 'junit:junit:4.12'
}
repositories {
    mavenCentral()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
}

我的android文件:

my android file :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.0.6'
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // 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
}

推荐答案

该错误是由项目级别文件中的Kotlin旧版本引起的,您可以像这样将其更新为最新版本:

The error is caused by the old version of Kotlin in your project level file, you can update it to the latest version like so:

ext.kotlin_version = '1.3.21'

关于您的警告:

  • 您应该从模块级别文件中删除显式构建工具版本(buildToolsVersion "26.0.2"),因为新的Android Gradle插件已经选择了正确的构建工具以自动使用.
  • 您应该查看警告中的链接,然后更新您的依赖配置,例如将compile替换为implementationapi,依此类推.
  • You should remove the explicit build tools version (buildToolsVersion "26.0.2") from your module level file, as the new Android Gradle plugins already pick the correct build tools to use automatically.
  • You should check out the link in the warnings and update your dependency configuration, e.g. replace compile with implementation or api, and so on.

这篇关于错误:Android Gradle插件仅支持Kotlin Gradle插件1.3.0及更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆