Hello everyone.
Unity version: 2018.2.3f1
Vuforia version: 7.2.24
I am experiencing some trouble when building a release APK for my Android app. The problem occurs when using both "Developer" license key and "Classic" license key.
When building an APK and checking "Development Build" in the Unity build settings, the app installs and functions as expected. However, when creating a release APK, Vuforia initialisation fails and the app launches to a black screen. Play mode in the Unity editor with a webcam also works as expected.
I have the following errors in logcat (when running release APK). The test device is a OnePlus 3 running Android 8.0:
09-10 18:32:19.385 2344 2412 I Unity : Compiled for Android
09-10 18:32:19.385 2344 2412 I Unity :
09-10 18:32:19.385 2344 2412 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
09-10 18:32:19.385 2344 2412 I Unity :
09-10 18:32:19.509 2344 2412 E Unity : AndroidJavaException: java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer
09-10 18:32:19.509 2344 2412 E Unity : java.lang.ClassNotFoundException: com.vuforia.VuforiaUnityPlayer.VuforiaInitializer
09-10 18:32:19.509 2344 2412 E Unity : at java.lang.Class.classForName(Native Method)
09-10 18:32:19.509 2344 2412 E Unity : at java.lang.Class.forName(Class.java:453)
09-10 18:32:19.509 2344 2412 E Unity : at java.lang.Class.forName(Class.java:378)
09-10 18:32:19.509 2344 2412 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
09-10 18:32:19.509 2344 2412 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
09-10 18:32:19.509 2344 2412 E Unity : at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
09-10 18:32:19.509 2344 2412 E Unity : at android.os.MessageQueue.next(MessageQueue.java:394)
09-10 18:32:19.509 2344 2412 E Unity : at android.os.Looper.loop(Looper.java:142)
09-10 18:32:19.509 2344 2412 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
09-10 18:32:20.162 2344 2412 E Unity : Vuforia cannot be started before it is initialized.
09-10 18:32:20.162 2344 2412 E Unity : Please disable Delayed Initializationin the Vuforia configuration or initialize Vuforia manually with the VuforiaRuntime-class.
I have tried manually initialising Vuforia by setting DelayedInitialization in Vuforia settings and calling VuforiaRuntime.Instance.InitVuforia(); - but this exhibits the same behaviour (works in development build, fails in release build).
Any additional insight would be much appreciated.
Thank you.
Hello @SPIFFAR,
Please see my response to your other post: https://developer.vuforia.com/forum/issues-and-bugs/android-production-black-camera#comment-68478
Thanks,
Vuforia Engine Support