如何为嵌入在android中的统一应用程序修复ClassNotFoundException?

时间:2019-09-04 08:02:43

标签: c# android android-studio unity3d

我在Embedded Unity within Android App之后嵌入了带有Android应用的统一应用。

我在我的统一项目中使用了两个统一插件NatCorder - Video Recording APIAndroid Native Pro插件。

这用于Unity 2018.3.8f和Android Studio 3.1。我的两个库文件都得到AndroidJavaException: java.lang.ClassNotFoundException:

日志:

09-05 11:46:00.587 22881-22925/com.example.mitesh.myapplication E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.stansassets.core.utility.AN_ImageWrapper
    java.lang.ClassNotFoundException: com.stansassets.core.utility.AN_ImageWrapper
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:400)
        at java.lang.Class.forName(Class.java:326)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:392)
        at android.os.Looper.loop(Looper.java:142)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.stansassets.core.utility.AN_ImageWrapper" on path: DexPathList[[zip file "/data/app/com.example.mitesh.myapplication-1/base.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_slice_0_apk.apk", 
09-05 11:46:00.605 22881-22925/com.example.mitesh.myapplication E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.stansassets.core.utility.AN_Logger
    java.lang.ClassNotFoundException: com.stansassets.core.utility.AN_Logger
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:400)
        at java.lang.Class.forName(Class.java:326)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:392)
        at android.os.Looper.loop(Looper.java:142)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.stansassets.core.utility.AN_Logger" on path: DexPathList[[zip file "/data/app/com.example.mitesh.myapplication-1/base.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_slice_0_apk.apk", zip file "/data/apk

09-05 11:47:42.810 23384-23423/com.example.mitesh.myapplication E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.stansassets.core.utility.AN_UnityBridge
    java.lang.ClassNotFoundException: com.stansassets.core.utility.AN_UnityBridge
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:400)
        at java.lang.Class.forName(Class.java:326)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:392)
        at android.os.Looper.loop(Looper.java:142)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.stansassets.core.utility.AN_UnityBridge" on path: DexPathList[[zip file "/data/app/com.example.mitesh.myapplication-1/base.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_slice_0_apk.apk", zip

09-05 11:46:57.671 22881-22925/com.example.mitesh.myapplication E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.yusufolokoba.natcorder.MP4Recorder
    java.lang.ClassNotFoundException: com.yusufolokoba.natcorder.MP4Recorder
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:400)
        at java.lang.Class.forName(Class.java:326)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:392)
        at android.os.Looper.loop(Looper.java:142)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.yusufolokoba.natcorder.MP4Recorder" on path: DexPathList[[zip file "/data/app/com.example.mitesh.myapplication-1/base.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.mitesh.myapplication-1/split_lib_slice_0_apk.apk", zip file "/data/ap

1 个答案:

答案 0 :(得分:0)

不可能,因为这些插件是为Unity制作的,不能用作android的插件。