Hi.
I'm integrating a Unity Scene(with Vuforia) into Android Studio and I'm having the following error:
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51) E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer 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$c$1.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:156) at com.unity3d.player.UnityPlayer$c.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vuforia.VuforiaUnityPlayer.VuforiaInitializer" on path: DexPathList[[zip file "/data/app/com.example.andoni.vumarksapplication-2/base.apk", zip file "/data/app/com.example.andoni.vumarksapplication-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.andoni.vumarksapplica E/mono: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at UnityEngine.AndroidJavaObject.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0 at UnityEngine.AndroidJavaObject.Finalize () [0x00000] in <filename unknown>:0 E/Unity: Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer 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$c$1.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:156) at com.unity3d.player.UnityPlayer$c.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vuforia.VuforiaUnityPlayer.VuforiaInitializer" on path: DexPathList[[zip file "/data/app/com.example.andoni.vumarksapplication-2/base.apk", zip E/mono: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at UnityEngine.AndroidJavaObject.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0 at UnityEngine.AndroidJavaObject.Finalize () [0x00000] in <filename unknown>:0 E/Unity: Vuforia cannot be started before it is initialized. Please disable Delayed Initializationin the Vuforia configuration or initialize Vuforia manually with the VuforiaRuntime-class. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51) |
To export the Unity Scene I followed this tutorials:
https://medium.com/@davidbeloosesky/embedded-unity-within-android-app-7061f4f473a
https://developer.vuforia.com/forum/android/using-android-studio-vuforia
Specifications:
Android Studio 3.0.1
Unity 2017.3.0f3
Vuforia 7
Android SDK API 26
Has someone experienced this issue before? Can anyone provide a solution?
Thanks in advance.
Hi!
For me, this didn't work. I ended up in importing the module into my project (not only the aar). The app wouldn't find the vuforia wrapper so I moved the line
from the module build.gradle to the app build.gradle. I also moved the VuforiaWrapper.aar file from the modules/lib to the app/lib folder. Now the app runs fine. Probably not the nicest solution but it solved my problems.
Best regards