Log in or register to post comments

Vuforia Initialization Error on Android 8.0

August 8, 2018 - 2:39am #1

Hi,

I'm trying to use ARCore sdk (with the unitypackage provided by Google) and Vuforia 7.2 in a same Unity Project. I found a workaround for Android 7.0 and everything is okay (for more informations, see my other topic https://developer.vuforia.com/forum/unity/can-we-use-arcore-unity-sdk-components-vuforia-72 ).

But on Android 8.0, I get a "INIT ERROR Failed to initialize Vuforia".

How to reproduce the behaviour :

- Create new Unity project with Unity 2018.1.6

- Delete Main Camera

- Add GameObject>Vuforia>AR Camera and Import Vuforia 7.2.24

- Switch platform to Android

- Check "Vuforia augmented reality supported" in Player Settings/XR Settings

- Check "ARCore supported" in Player Settings/XR Settings

- Change package name

- uncheck android tv compatibility

- select android 7 in minimum api level

- uncheck multithreaded rendering

- click on ARCamera -> Open Vuforia Configuration and add a license.

- Build & run on Android 8.0 : INIT ERROR Failed to initialize Vuforia.

- Build & run on Android 7.0 : it works

- Uninstall app on your Android 8.0 device

- uncheck "ARCore supported" in Player Settings/XR Settings

- Build&run on Android 8.0 : it works

- Now check again "ARCore supported" and build&run on the same Android 8.0 device : it still works

You can find the UnityProject I tested on in attachments.

 

Behaviour expected : it should work on Android 8.0 as it works on Android 7.0. We should not have "Vuforia Initialization Error".

devices tested : Samsung Galaxy S7 Edge and S8+ with Android 8.0, Samsung Galaxy S7 Edge and S7 with Android 7.0

I also have the issue with Vuforia 7.1.36 and Unity 2018.2.

 

With "adb logcat" I have these logs :

Quote:

08-08 15:03:04.681 30118 30138 D Vuforia : Initializing Vuforia...

08-08 15:03:04.681 30118 30138 I System.out: Native library libVuforia.so loaded

08-08 15:03:04.696 30118 30138 E AR : Error - failed to assert required Android permissions. Failed to initialize Vuforia SDK. All required Android permissions must be included for the SDK to work.

08-08 15:03:04.696 30118 30138 E Vuforia : Vuforia initialization failed

08-08 15:03:04.744 30118 30138 E Unity : Vuforia initialization failed

08-08 15:03:04.744 30118 30138 E Unity :

08-08 15:03:04.744 30118 30138 E Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

08-08 15:03:04.744 30118 30138 E Unity :

08-08 15:03:04.762 30118 30138 E Unity : Vuforia initialization failed: INIT_ERROR

08-08 15:03:04.762 30118 30138 E Unity :

08-08 15:03:04.762 30118 30138 E Unity : INIT ERROR

08-08 15:03:04.762 30118 30138 E Unity :

08-08 15:03:04.762 30118 30138 E Unity : Failed to initialize Vuforia.





 

EDIT : Finally, I found a solution !

As specified in the logcats, it was an error with permissions so I checked AndroidManifest.xml generated by unity in Your_Unity_Project/Temp/StagingArea folder.

And I found this strange line : <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />

Unity add this line when you check ARCore supported, I don't know why. Because of this, the user couldn't allow the app to use camera, resulting in Vuforia init error.

To fix it, I copied and pasted this AndroidManifest in UnityProject/Assets/Plugins/Android folder and changed, in the line above, android:value="true" by android:value="false", and it worked with Vuforia and ARCore both checked in XR Settings !

AttachmentSize
Package icon Test_Vuforia_tmp.zip1.11 MB

Vuforia Initialization Error on Android 8.0

August 8, 2018 - 11:02am #2

Hello @wipon,

Thank you for posting a workaround.

-Vuforia Engine Support

Log in or register to post comments