我知道我是否需要启用 Multi-Dex 吗?(ClassNotFoundException) [英] Do I know if I need Multi-Dex enabled? (ClassNotFoundException)

查看:21
本文介绍了我知道我是否需要启用 Multi-Dex 吗?(ClassNotFoundException)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然并且似乎没有任何原因,以下错误开始出现.经过一整天的斗争,我发现启用 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.lang.ClassNotFoundException:未找到类

这是在以下版本中创建 Java classes.zip 文件时的一个已知问题:

This is a known issue in the creation of the Java classes.zip file in the following release:

2017 年 12 月 4 日 - Xamarin.Android 8.1.0.24

December 4th, 2017 - Xamarin.Android 8.1.0.24

  • 此版本包含在 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆