我构建了一个应用程序来使用 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
and mutableStateOf
它们都是从 androidx.compose.runtime 导入的,但我在任何地方都找不到任何信息......
Here the dependencies block
我通过升级到BETA并遵循本要点中的所有步骤解决了这个问题https://gist.github.com/mitchtabian/f1327d392e3c0ab9ac416c91204c329b https://gist.github.com/mitchtabian/f1327d392e3c0ab9ac416c91204c329b
我不能确定是什么导致了这个问题,但很可能是版本不匹配,所以感谢那些向我指出这一点的人。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)