BabylonReactNative
BabylonReactNative copied to clipboard
Adding BabylonReactNative to a project already containing packages that require ARCore may fail to build
Adding BabylonReactNative to a project containing Viro React Community(https://github.com/ViroCommunity/viro) fails to build:
[:arcore_client] /project/node_modules/react-viro/android/arcore_client/build/.transforms/8a1c382d15b6830d95b4fffc34498914/jetified-core-1.10.0/AndroidManifest.xml Warning: Package name ‘com.google.ar.core’ used in: :arcore_client, com.google.ar:core:1.14.0.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use ‘–warning-mode all’ to show the individual deprecation warnings. See Command-Line Interface 265 actionable tasks: 5 executed, 260 up-to-date /project/android/app/src/debug/AndroidManifest.xml:35:13-38 Error: Attribute meta-data#com.google.ar.core.min_apk_version@value value=(190519000) from [:arcore_client] AndroidManifest.xml:35:13-38 is also present at [com.google.ar:core:1.14.0] AndroidManifest.xml:35:13-38 value=(191106000). Suggestion: add ‘tools:replace=“android:value”’ to element at AndroidManifest.xml:33:9-35:41 to override.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ‘:app:processDebugMainManifest’. Manifest merger failed with multiple errors, see logs`
Both require ARCore 1.14.0, but Viro React targets Android SDK 24 whilst BabylonReactNative targets SDK 28.
Removing implementation 'com.google.ar:core:1.14.0'
from Babylon build.gradle
fixed the issue for now. Playground scene is running with no issues whatsoever.
Hi @dmegue Are you referring to this particular line to remove ? https://github.com/BabylonJS/BabylonReactNative/blob/5463b3a5605eb10ade59ade2eeab42cd65442820/Modules/%40babylonjs/react-native/android/build.gradle#L128
I think we still need that one because that is the project that ultimately compiles all the Babylon Native code for Android. I think the one we want to remove is this one: https://github.com/BabylonJS/BabylonReactNative/blob/master/Package/Android/build.gradle#L80. That's the one @dmegue tested removing in their project.
A bit more context here: https://forum.babylonjs.com/t/issue-setting-up-babylonjs-on-rn/20647/5?u=ryantrem
Hi @CedricGuillemet the one i removed was the one @ryantrem linked above
https://github.com/BabylonJS/BabylonReactNative/blob/master/Package/Android/build.gradle#L80. That's the one @dmegue tested removing in their project.
Since things blow up if ARCore is not included, then I think ideally we would detect from the BRN gradle file whether ARCore is already included in the project, and only include it ourselves if the host project is not including it. If that is not possible, then a simpler (but less "automatic") solution would be to include ARCore by default, but allow the consuming project to set some variable that tells our gradle not to include ARCore.
Hello 👋
Any updates on this ?
hi @gregoryalary 1 year without update. :/ Sorry for that. Is it still a need on your side?
Hi @CedricGuillemet, if i recall correctly we decided to pick another library.