Topic locked

Android M Vuforia Initializing failed

October 19, 2015 - 3:51am #8

Description of the issue:

Only on Android M (Android 6) on my Nexus 5 the vuforia initializing failed. On many other devices it works pretty good from Android 4 to Android 5. Datasetcopier script write datasets on device from obb. No error in console about that. But files are missing on Android 6 device. 

Exact Device Model number:

LG Nexus 5

Installed OS version:

Android 6

Vuforia SDK version

Vuforia SDK 5.0.6


Android with Unity 5.2.1p3

Error Logs:

10-19 12:39:55.895    3576-3611/de.packagename D/QCAR﹕ Setting Unity version 5.2.1
10-19 12:39:55.927    3576-3611/de.packagename E/Unity﹕ Vuforia initialization failed
    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)
10-19 12:39:55.931    3576-3611/de.packagename E/Unity﹕ Vuforia initialization failed:
    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    Vuforia.DefaultInitializationErrorHandler:SetErrorCode(InitError) (at /Users/tobias/Documents/Projekte/ar-app/unity3d/App/Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs:82)
    Vuforia.DefaultInitializationErrorHandler:OnVuforiaInitializationError(InitError) (at /Users/tobias/Documents/Projekte/ar-app/unity3d/App/Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs:156)
    (Filename: /Users/tobias/Documents/Projekte/ar-app/unity3d/App/Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs Line: 82)
I´m using a datasetcopier script to get datasets out of OBB file. It writes the files to:  /data/user/0/de.packagename/files/mydataset.dat
but i can´t see the dataset files on /sdcard/Android/data/de.packagename/files/*
Could this be a Android M (6) permission error?
I can´t see the files but vuforia are able to load the dataset:
10-19 12:39:55.936    3576-3611/de.packagename I/Unity﹕ Trackable mermaid-9-gespiegelt lost
10-19 12:39:55.940    3576-3611/de.packagename I/Unity﹕ Trackable mermaid-1-gespiegelt lost

Device orientation:

Landscape. We never use Portrait mode.

Back/Front Camera:

We only use Back camera.

Camera Mode:


Concurrent camera access:

Camera works good.


Android M Vuforia Initializing failed

October 21, 2015 - 2:23am #7

Same problem here, after I updated my phone it's just fail to work. When I install the same APK on the another devives, it's okay. Any idea ? 

Android M Vuforia Initializing failed

October 21, 2015 - 3:18am #6

What is the targetSDK and minSDK in your Android manifest ? 

Android M Vuforia Initializing failed

October 21, 2015 - 3:24am #5

I made this project clearly in Unity, the minimum API level (set by  Unity) is 4.2

/plungins/Android/AndroidManifest.xml hasn't set anything like targetSDK or minSDK

Android M Vuforia Initializing failed

October 21, 2015 - 3:32am #4

Could you check the AndroidManifest xml in the YOUR_UNITY_PROJECT / Temp / StagingArea folder ?

(note: the Temp/Staging Area folder is created by Unity when geenrating your APK; you need to leave Unity Editor open, cause if you close it, you'll lose that folder)


Android M Vuforia Initializing failed

October 21, 2015 - 3:40am #3

Oh, I 've learned something new today :) Thanks, this is what I found

  <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />

Android M Vuforia Initializing failed

October 21, 2015 - 3:54am #2

OK, so, basically here Unity is automatically injecting the targetSDKversion into the generated AndroidManifest.xml, setting it to API level "23" (which means Android 6.0 API).

But API level 23 requires explicit camera access from the user, hence the error.

To fix this, you simply need to add this line into the AndroidManifest.xml under Assets/Plugins/Android, setting the targetSDKversion to a value lower than 23 (e.g. set it to 21 or 22):

<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="22" />

This will make it work on any device (including those on Android 6.0, as well as the ones on older versions, down to the minSDKVersion you have set)

Android M Vuforia Initializing failed

October 21, 2015 - 4:15am #1

It works ! Thank you very much

Topic locked