App crashes after running the program with failed to initialize Vuforia with permission exception
Android version is <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
testing on device 4.1.1 (api level 16) with front camera only.
Permission included in manifest file:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-feature android:glEsVersion="0x00020000" />
exception at SampleApplicationSession
's InitVuforiaTask
Task, value of Vuforia.init()
returned is -1.
Not sure what I missed.
Library included are armaebi-v7a/libVuforia.so, android-support-v4, jpct_ae, Vuforia
I have faced the same problem. If you see the example comes with the compiledSdKversion 22 because in newer versions the user have to explicitly give the Camera permission. My project is working with API 25 by adding some code to my android application. In my case, I asked for the Camera Permission before opening the vuforia activity when an user clic a FloatingActionButton:
The VideoPlayback is the activity that use AR from vuforia included in the advance examples. In this case you have to listen to an onRequestPermissionsResult because we have to check the user's answer.
In the onRequestPermissionsResult we check if the answer was positive an if so we open the activity.
I hope it works for you too.