"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Vuforia initialisation fails on Android when "Development Build" is unchecked

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 paul28b,

What code are you using to initialize Vuforia? Are you seeing this on all Android devices, or just the one mentioned in your post? Do you have your initialization code blocked out by a development mode build flag by accident?

Thanks,

Vuforia Engine Support

Hi Strasza.

 

This behaviour occurs on both OnePlus 3 and Samsung Galaxy S7 both running Android 8. We have not tested on other Android devices so far, but have tested the same app on various iOS devices with success.

 

We have the same issue, I can't build non development and have vuforia initialize. Galaxy S8 is failing with Unity 2019 and Vuforia 8.1.7 using the IL2CPP backend. This is really blocking us.

 

Hello @SPIFFAR,

Do you also experience the issue with Unity 2018.4? We have several open issues with 2019.1 that we are working to resolve: https://developer.vuforia.com/forum/unity/known-issues-unity-20191

Thanks,

Vuforia Engine Support

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