我的程序中没有使用Kotlin,之前一直很正常。但是当我将目标版本从26升级到28之后出现了问题。我对Kotlin一无所知。每次尝试同步gradle文件时都出错:
org.jetbrains.kotlin.gradle.KotlinGradleModel.getImplements()Ljava/util/List;
为什么会这样发生呢?
我的Gradle文件是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.pr20020897.dms"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:28.0.0-alpha1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
项目级别Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我认为,Android Studio本身存在问题,因为我尝试创建新项目,但仍然遇到相同的错误。
build.gradle
。 - Rohit5k228.0.0
是在九月发布的。 - OneCricketeerclasspath 'com.android.tools.build:gradle:3.2.0'
了吗?这可能会有所帮助,但是看起来你没有使用kotlin,所以尝试更新gradle并查看发生了什么。 - ʍѳђઽ૯ท