Log in or register to post comments

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

September 10, 2018 - 11:24am #1

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.

 

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

June 11, 2019 - 9:04am #6

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

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

June 10, 2019 - 10:38am #5

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

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

June 6, 2019 - 7:00pm #4

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.



 

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

September 11, 2018 - 2:08am #3

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.

 

When attempting to initialise Vuforia manually, the "DelayedInitialization" setting was toggled off in the Unity inspector of the Resources/VuforiaConfiguration asset. A call to VuforiaRuntime.Instance.InitVuforia(); was then made in the Start() method of the main GameController script (being sure to include Vuforia namespace). Additionally, the VuforiaBehaviour component was disabled on the ARCamera object using the Unity inspector, and enabled programmatically in the Start() method of the GameController before attempting to initialise Vuforia.

 

There is no code we have written that is executed conditionally for build/release.

 

From further investigation, I have managed to narrow down this issue to building using the IL2CPP scripting backend, or building using the mono scripting backend with Proguard minification. 

 

An APK built using the mono scripting backend with minification disabled produces a release APK that operates correctly, however losing ARM64 support is obviously not ideal.

 

Thank you for taking a look at this.

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

September 10, 2018 - 4:11pm #2

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

Log in or register to post comments