Dev
Dev

Reputation: 857

Android Unity3d and VUForia with Digimarc. Failure to initialize! Your hardware does not support this application

I am developing an AR application where I have used Unity with VUForia to run AR scenes. The Unity AR part has been developed using Unity Plugins, and I integrated this plugin with Android Studio Project. The Android project also have use of Digimarc SDK to identify SKU. Now the Problem is when I run complete project which is integrated with Digimarc I get the Error from Unity : Failure to initialize! Your hardware does not support. But if I removes the Digimarc SDK from the project the Unity part runs perfect.

Upvotes: 1

Views: 487

Answers (1)

Dev
Dev

Reputation: 857

After research for 2 days I found the root cause and the solution for this issue.

Problem:

There are multiple hardware architecture in android like "armeabi-v7a" , "arm64-v8a" and "x86". Most of the Android devices supports more than one architecture. When an application has use of native libs, it supplies the native lib for supporting architectures in respective folders like lib/armeabi-v7a/ and lib/arm64-v8a etc. The OS of the Android device checks the supplied folders for native libs at the time of compilation, and copies the most compatible folder and leave others. In my case, the VUForia SDK supplies native libs only for "armeabi-v7a" architechture, but the Digimarc SDK supplies native libs for "armeabi-v7a" , "arm64-v8a" and "x86". Now when I install Unity+vuforia only app to the device as it has only "armeabi-v7a" folder the device copies libs from here and the app runs properly. But when we install the complete app which has both the unity+vuforia and the Digimarc integrated, the application package does contains merged folders for all 3 architecture, but the VuForia libs are available only in "armeabi-v7a" folder rest 2 does contains digimarc's libs only, they does not have libs of VUForia. Now the devices which copies "arm64-v8a" or "x86" libs, will does not find required libs for VUforia and we see the Hardware not supported error on such devices.

Solution:

First I tried to look for VUForia libs for "arm64-v8a" and "x86" but was not able to find. Then I tried to copy VUforia libs from "armeabi-v7a" folder and pasted in "arm64-v8a" and "x86" folders, but when I tried to run the app, it got crashed with the complain the the provided libs are not for correct architecture. Finally I removed "arm64-v8a" and "x86" folders from digimarc's "dms.aar" file and renamed it as "dms_armeabi-v7a_only.aar", and replaced the origional "dms.aar" with "dms_armeabi-v7a_only.aar" in the project I tried running the app on all devices which I have access to and the app worked fine for both digimarc and Unity+Vuforia pages.

Upvotes: 1

Related Questions