![](/img/trans.png)
[英]Gradle plugin supports only Kotlin Gradle plugin version 1.3.40 and higher Error when upgrading android studio gradle from 4.2.2 to 7.0.0
[英]ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher
请问我该如何解决这个错误?
错误:Android Gradle插件仅支持Kotlin Gradle插件版本1.3.0及更高版本。 以下依赖项不满足所需版本:root项目'android' - > org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.6受影响的模块:android-app
警告:配置'compile'已过时,已被'implementation'和'api'取代。 它将在2018年底删除。有关更多信息,请参阅: http : //d.android.com/r/tools/update-dependency-configurations.html受影响的模块:android-app
警告:配置'testCompile'已过时,已替换为'testImplementation'。 它将在2018年底删除。有关更多信息,请参阅: http : //d.android.com/r/tools/update-dependency-configurations.html受影响的模块:android-app
警告:配置'androidTestCompile'已过时,已被'androidTestImplementation'取代。 它将在2018年底删除。有关更多信息,请参阅: http : //d.android.com/r/tools/update-dependency-configurations.html受影响的模块:android-app
警告:指定的Android SDK Build Tools版本(26.0.2)将被忽略,因为它低于Android Gradle Plugin 3.3.1的最低支持版本(28.0.3)。 将使用Android SDK Build Tools 28.0.3。 要取消此警告,请从build.gradle文件中删除“buildToolsVersion '26 .0.2'”,因为每个版本的Android Gradle Plugin现在都有一个默认版本的构建工具。 删除Build Tools版本和同步项目受影响的模块:android-app
我的android-app文件:
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文件:
// 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引起的,您可以将其更新为最新版本,如下所示:
ext.kotlin_version = '1.3.21'
至于你的警告:
buildToolsVersion "26.0.2"
),因为新的Android Gradle插件已经选择了自动使用的正确构建工具。 compile
与implementation
或api
,等等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.