We would like to expose some functionality from ARCore through to Unity using NDK. The basic setup is as follows:
1. Take the ARCore sample project from the Android SDK
2. Implement a few new functions in the ARCore sample project in Android Studio
3. Build the project in Android Studio as a module
4. Bring the module into a Unity project and use the functions in the Unity app
To get started, we are stubbing out step 2 with a simple test function. This lets us verify the build setup is sane.
The workflow ultimately errors out in Unity because there are two ARCore modules: one from the sample module and one that Unity brings in from ARFoundation:
More than one file was found with OS independent path 'lib/armeabi-v7a/libarcore_sdk_c.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
In the build, we want to use the ARCore lib that is bundled with Unity's ARFoundation. The problem is if we remove the ARCore lib from the Android module, then that module doesn't build in Android Studio.
Is there a way to compile the ARCore sample without bundling the APCore library, then the linker can use the ARFoundation one once it's brought into Unity? Does anyone have a sample project?
↧