我构建了一个应用程序来处理Jetpack compose。在alpha-11之前一切正常,但由于我试图将其更新到alpha-12 (甚至beta-1),应用程序在运行时失败,并显示错误NoClassDefFoundError: Failed resolution of: Landroidx/compose/runtime/MutableStateKt;
另外还说:
Didn't find class "androidx.compose.runtime.MutableStateKt" on path: DexPathList[[zip file "/data/app/com.example.APPNAME-TeAYAMsRf0C9pLQOdWShCA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.APPNAME-TeAYAMsRf0C9pLQOdWShCA==/lib/x86, /system/lib, /system/product/lib]]
该错误是由使用MutableState和mutableStateOf引起的,这两个文件都是从androidx.compose.runtime导入的,但我在任何地方都找不到任何信息……
这里的依赖关系块

发布于 2021-03-02 21:13:54
我通过升级到测试版并遵循这个gist https://gist.github.com/mitchtabian/f1327d392e3c0ab9ac416c91204c329b中的所有步骤解决了这个问题
我不能确切地说是什么导致了这个问题,但它很可能是版本不匹配,所以感谢那些给我指出这个问题的人。
https://stackoverflow.com/questions/66429770
复制相似问题