昨天以前一切都很好。今天,当我打开系统时,我突然发现了一个错误:
java.lang.IllegalStateException: function = <anonymous>, count = 3, index = 3连同“内部编译器错误”一起运行我的项目。
我试着更新我的gradle版本和gradle插件版本,以及我使用过的依赖项,但是它没有起作用。
我该怎么解决这个问题?
这些是我使用过的依赖项:
def lifecycle_version = "2.3.1"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.shawnlin:number-picker:2.4.11'
implementation 'com.karumi:dexter:6.2.1'
implementation 'com.github.IslamKhSh:CardSlider:1.0.1'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.0'
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC2'
// Lottie dependency
implementation "com.airbnb.android:lottie:3.7.0"
//Autostart settings open
implementation 'com.thelittlefireman:AppKillerManager:2.1.1'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
// JSON Parsing
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.cardview:cardview:1.0.0'
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31"
implementation "org.koin:koin-core:2.2.2"
implementation "org.koin:koin-androidx-viewmodel:2.2.2"
implementation "androidx.datastore:datastore-preferences:1.0.0-beta01"
implementation 'com.github.pwittchen:swipe-rx2:0.3.0'
implementation "androidx.compose.material:material:1.0.0-beta06"
implementation "androidx.compose.ui:ui-tooling:1.0.0-beta06"
implementation "androidx.compose.ui:ui:1.0.0-beta07"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha06"
implementation "androidx.navigation:navigation-compose:1.0.0-alpha10"
implementation "androidx.activity:activity-compose:1.3.0-alpha08"
implementation "androidx.compose.animation:animation:1.0.0-beta06"
implementation "androidx.compose.animation:animation-core:1.0.0-beta07"
implementation "androidx.ui:ui-framework:0.1.0-dev03"
implementation "androidx.compose.runtime:runtime-livedata:1.0.0-beta06"
implementation group: 'com.airbnb.android', name: 'lottie-compose', version: '1.0.0-beta03-1'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'发布于 2021-05-19 12:50:33
如果我将所有编写成beta6和组合导航到1.0.0-alpha08的实现降级,我就为我工作了。或者您应该将kotlinCompilerExtensionVersion更新为1.0.0-beta7 in composeOptions(在build.gradle中,app模块中),如下所示:
android {
...
composeOptions {
val composeVersion by extra("1.0.0-beta07")
kotlinCompilerExtensionVersion = composeVersion
}
...
}这个样本在build.gradle.kts中
发布于 2021-05-19 06:59:58
在我的例子中,将ConstraintLayout版本从1.0.0-alpha07降级为1.0.0-alpha06起到了帮助作用。
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha06"发布于 2021-05-20 23:18:58
我能够通过将所有组合依赖项升级到beta07以及kotlinCompilerExtensionVersion到1.0.0-beta07来修复这个问题。
我也使用伴奏者库,它需要升级到版本"0.10.0“,该版本是为使用compose beta07而构建的。
https://stackoverflow.com/questions/67597922
复制相似问题