问题描述
突然,似乎根本没有任何原因,以下错误开始出现.经过一整天的努力,我发现启用Multi-Dex可以解决该问题.此错误是否可能是由于我违反了64k参考阈值?
Suddenly and seemingly for no reason at all, the following error starts presenting itself. After fighting it all day, I discovered enabling Multi-Dex resolved it. Is this error potentially caused by my breaching the 64k reference threshold?
java.lang.RuntimeException: Unable to instantiate application md52323d240c954a07dbdbeb3f1c41a0cab.MainApplication: java.lang.ClassNotFoundException: Didn't find class "md52323d240c954a07dbdbeb3f1c41a0cab.MainApplication" on path: DexPathList[[zip file "/data/app/com.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp-1/lib/arm64, /data/app/com.myapp-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:823)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5529)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1576)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:241)
at android.app.ActivityThread.main(ActivityThread.java:6281)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
我可以在哪里看到引用计数?我怎么知道是否超过了-特别是在VS中?
Somewhere I can see the count of references? How do I know if I surpassed this - in VS specifically?
推荐答案
在以下版本的Java classes.zip
文件的创建中,这是一个已知问题:
This is a known issue in the creation of the Java classes.zip
file in the following release:
- 此版本包含在Visual Studio 2017 15.5版中.
Java.lang.ClassNotFoundException
关于运行在"Java.Lang.ClassNotFoundException:在路径:DexPathList上找不到类"的应用程序,我们有多个报告.
We have had multiple reports regarding applications running into a "Java.Lang.ClassNotFoundException: Didn't find class on path: DexPathList" exception.
错误: xamarin.android_8.1/#Known_Issues
GitHub PR修复程序: https://github.com/xamarin/xamarin-android/pull/1142
GitHub PR fix: https://github.com/xamarin/xamarin-android/pull/1142
您可以清理/重建作为Windows上的解决方法,以便重新创建Java classes.zip
文件
You can clean/rebuild as a workaround on Windows in order to recreate the Java classes.zip
file
这篇关于我是否知道是否需要启用Multi-Dex? (ClassNotFoundException)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!