我将gradle构建工具升级到了
classpath 'com.android.tools.build:gradle:3.4.2'
但是从那时起,我无法运行该项目并出现错误
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Cannot parse result path string:
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2048)
at com.google.common.cache.LocalCache.get(LocalCache.java:3850)
当我将gradle更改为版本3.4.1时,它的效果很好。可能是什么问题?
编辑:
我的项目build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
和app build.gradle是
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "x.x.x."
minSdkVersion 22
targetSdkVersion 28
versionCode 2
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
resValue("string", "PORT_NUMBER", "8081")
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'com.google.dagger:dagger-android-support:2.19'
implementation 'com.jakewharton:butterknife:10.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation "androidx.lifecycle:lifecycle-runtime:2.0.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0"
implementation "androidx.room:room-runtime:2.2.0-alpha02"
debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
annotationProcessor "androidx.room:room-compiler:2.2.0-alpha02"
annotationProcessor 'com.google.dagger:dagger-android-processor:2.19'
annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
}