gpt4 book ai didi

android-studio - 如何解决java.lang.NoSuchFieldError : No field Companion of type Landroidx/compose/runtime/SlotTable$Companion?

转载 作者:行者123 更新时间:2023-12-04 13:30:50 35 4
gpt4 key购买 nike

我在所有 Jetpack compose 项目中多次收到此错误。此错误是否与 Gradle 相关?因为我没有对主题进行任何更改。

java.lang.NoSuchFieldError: No field Companion of type Landroidx/compose/runtime/SlotTable$Companion; in class Landroidx/compose/runtime/SlotTable; or its superclasses (declaration of 'androidx.compose.runtime.SlotTable' appears in /data/app/~~-cK_xmGsJokhf6B_7aQseg==/com.swetajain.library-CN37OSea3A4uAWXYCBb63w==/base.apk)
Logs
app.build.gradle
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "com.google.android.material:compose-theme-adapter:$compose_version"
api 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-beta01'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-beta01@aar'
implementation 'androidx.activity:activity-ktx:1.2.0-beta01@aar'
implementation "dev.chrisbanes.accompanist:accompanist-coil:0.3.3.1"
def nav_compose_version = "1.0.0-alpha02"
implementation "androidx.navigation:navigation-compose:$nav_compose_version"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
build.gradle - 项目
buildscript {

ext.compose_version = '1.0.0-alpha04'
ext.kotlin_version = "1.4.20"

repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0-alpha16"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
gradle\wrapper\gradle-wrapper.properties

最佳答案

如果您看到此类错误,请尝试将您的撰写版本更新到最新版本。
java.lang.NoSuchFieldError: No field Companion of type Landroidx/compose/foundation/layout/BoxScope$Companion;

关于android-studio - 如何解决java.lang.NoSuchFieldError : No field Companion of type Landroidx/compose/runtime/SlotTable$Companion?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65161417/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com