作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚刚将 compose 版本更新为 1.0.0-beta07,它显示了这个运行时错误
No interface method startRestartGroup(ILjava/lang/String;)Landroidx/compose/runtime/Composer; in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer'
....
at com.google.accompanist.coil.CoilImage__CoilKt.CoilImage(Coil.kt:245)
at com.google.accompanist.coil.CoilImage.CoilImage(Coil.kt:1)
下面是我的 gradle 依赖文件
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation "androidx.compose.compiler:compiler:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation 'androidx.activity:activity-compose:1.3.0-alpha08'
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha05"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation "io.coil-kt:coil-gif:1.2.1"
implementation "io.coil-kt:coil-svg:1.2.1"
implementation "com.google.accompanist:accompanist-coil:0.6.2"
和版本
compose_version = '1.0.0-beta07'
最佳答案
每个库都需要针对 beta07
重新编译工作,根据 Compose release notes :
Note: Libraries dependent on Compose will need to recompile with version 1.0.0‑beta07. Otherwise, libraries may encounter a
NoSuchMethodError
, such as:java.lang.NoSuchMethodError: No interface method startReplaceableGroup(ILjava/lang/String;)V in class Landroidx/compose/runtime/Composer; or its super classes. (Ia34e6)
0.10.0
更新伴奏库。 .
implementation "com.google.accompanist:accompanist-coil:0.6.2"
至
implementation "com.google.accompanist:accompanist-coil:0.10.0"
关于android - 将 Jetpack Compose 升级到 1.0.0-beta07 后的 java.lang.NoSuchMethodError startRestartGroup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67667099/
我刚刚将 compose 版本更新为 1.0.0-beta07,它显示了这个运行时错误 No interface method startRestartGroup(ILjava/lang/String
我是一名优秀的程序员,十分优秀!