2

I'm still trying to use ARCore for a native Android app in another IDE (Visual Studio) instead of Android Studio. That's why I need to "DIY" numbers of things (like manually add ARCore dependency in my APK package). So far I made some progress but still the AR session creation fails.

First, it gives me the following error message:

System.err: java.lang.RuntimeException: Application manifest must contain meta-data com.google.ar.core.min_apk_version System.err: at com.google.ar.core.SessionCreateJniHelper.getMinApkVersion(SessionCreateJniHelper.java:62) third_party/arcore/ar/core/android/sdk/session_create.cc: Calling getMinApkVersion failed.

I followed the suggestions given in the message and add the following line in AndroidManifest.xml:

<meta-data android:name="com.google.ar.core.min_apk_version" android:value="24"/>

After doing this, the first error is solved, but it gives a new error:

[blaze-out/android-armeabi-v7a-opt/genfiles/third_party/arcore/ar/core/android/arcore_c_shim_function_impls.inc:375] CHECK failed: expression='"false"' Failed to call function: ArSession_createImplementation, this function version: 171127000 is higher than requested min apk version

I can not get rid of this error. Anyone know the reason about it? What's meaning of the function's version is higher than requested min apk version?

Hongkun Wang
  • 717
  • 8
  • 22
  • Off topic - why are you working with Visual Studio instead of Android Studio if it makes developing so difficult? – Ridcully Apr 14 '18 at 14:36
  • Sometimes If you have large scale code already done in another IDE, you may think about saving the time on migrating to new IDE (Android Studio). Besides, it may be that difficult to using Visual Studio, that's why I wanted to try my luck. Now it is working. – Hongkun Wang Apr 14 '18 at 14:53

2 Answers2

3

Found answer myself: ArCore 1.1 requires the following meta-data must be in the app's AndroidManifest.xml. See the AndroidManifest.xml in the ARCore's aar package.

<meta-data android:name="com.google.ar.core.min_apk_version" android:value="180226000" />

Android studio will merge this meta-data into the final app's ANdroidManifest.xml but Visual Studio does not do any manifest merging. So the solution is manually add it into the manifest. ARSession is now successfully created.

Hongkun Wang
  • 717
  • 8
  • 22
0

It took me about 2 days to make ArCore works with Visual Studio (at least AR session is now created). I'd like to share my experience about how to "DIY" to add ARCore in a native Android app in the IDE other than Android Studio:

  1. You need to download ARCore 1.1.0 from maven repository, search it out then click "aar" link so you can download the full package. Alternatively, you can build sample app "hello_ar_c" by Android Studio and then find the aar package in gralde cache directory: "[user dir].gradle\caches\transforms-1\files-1.1\core-1.1.0.aar".

  2. Manage to make ARCore shared library (libarcore_sdk_c.so) packed into your app's APK file under "/lib".

  3. Manage to make ARCore java library (classes.jar) packed into your app's APK file by DEX tools.

  4. Enable ARCore for your app in AndroidManifext.xml by following ARCore guide

  5. Manually add the meta-data "min_apk_version" in AndroidManifest.xml

The step 5 is the most tricky part since ARCore guide does not mentioned this and Android Studio silently add it after merging the manifest.

Hope ArCore team could provide some guide line of using ARCore with other IDEs.

Hongkun Wang
  • 717
  • 8
  • 22