关于OPPO R11上面运行项目出现ClassNotFoundException问题的原因及解决方案记录

这个项目很简单,只是用了一个AgentWeb展示一个网页的功能,其他手机上面都没有问题,只有OPPO R11上面报了这个问题,找了度娘也没有解决。真是捉急吖!!!

回归正题,错误如下:

2019-03-25 15:03:02.219 593-3069/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
2019-03-25 15:03:02.633 593-3069/? E/ANDR-PERF-RESOURCEQS: Failed to reset optimization [3, 0]
2019-03-25 15:03:03.486 593-3069/? E/ANDR-PERF-MPCTL: invalid request, no optimizations performed
    
    --------- beginning of system
2019-03-25 15:03:03.490 593-3069/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
2019-03-25 15:03:03.491 1686-1697/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.example.wissdom.xinhuaproject/com.example.wissdom.xinhuaproject.MainActivity/1
2019-03-25 15:03:03.511 593-3069/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [3, 22]
2019-03-25 15:03:03.555 3412-3743/? E/OpenGLRenderer: hwui_debug::CanvasContext createSurface sur=0x0, isValid =0
2019-03-25 15:03:03.567 1783-1783/com.example.xinhuaproject E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.xinhuaproject, PID: 1783
    java.lang.RuntimeException: Unable to instantiate application android.support.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.example.xinhuaproject-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.xinhuaproject-1/lib/arm64, /system/lib64, /vendor/lib64]]
        at android.app.LoadedApk.makeApplication(LoadedApk.java:853)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5748)
        at android.app.ActivityThread.-wrap2(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1716)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:185)
        at android.app.ActivityThread.main(ActivityThread.java:6615)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:916)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:806)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.example.xinhuaproject-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.xinhuaproject-1/lib/arm64, /system/lib64, /vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.Instrumentation.newApplication(Instrumentation.java:993)
        at android.app.LoadedApk.makeApplication(LoadedApk.java:847)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5748)?
        at android.app.ActivityThread.-wrap2(ActivityThread.java)?
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1716)?
        at android.os.Handler.dispatchMessage(Handler.java:102)?
        at android.os.Looper.loop(Looper.java:185)?
        at android.app.ActivityThread.main(ActivityThread.java:6615)?
        at java.lang.reflect.Method.invoke(Native Method)?
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:916)?
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:806)?
2019-03-25 15:03:03.580 1686-4396/? E/Process: get_ion_cache_memory: Unable to open /d/ion/heaps/ion_mm_heap
2019-03-25 15:03:05.491 593-3069/? E/ANDR-PERF-RESOURCEQS: Failed to reset optimization [3, 0]

乍一看,还以为是分包问题导致的,然后就一直整这么个破玩意儿,实际上不是这个问题。

先说一下解决方案吧,解决方案就是用release包通过命令安装到手机上,问题完美解决了。记住,一定要是release签名包才可以的哦。

那这是什么问题呢,为什么debug包就会崩溃,release包就不会呢?其实说实话,我也不太清楚,不过经过和我认为的大神讨论后觉得应该是手机系统的架构问题。如果有知道的可以在评论区留言一下,大家互相学习,互相进步吖。

你可能感兴趣的:(开发中遇到的问题)