Fix ARcore dep, iOS deployment#732
Merged
CedricGuillemet merged 6 commits intoMay 11, 2026
Merged
Conversation
Collaborator
CedricGuillemet
commented
May 11, 2026
- Detect ARcore lib path with user overiding version
- iOS min deployment is now 16+
The -DARCORE_LIBPATH cmake argument was hardcoded to core-1.22.0.aar in Modules/@babylonjs/react-native/android/build.gradle. If a consumer project applies a resolutionStrategy.force on com.google.ar:core (for example to resolve a duplicate-class conflict between core:1.22.0 and installreferrer:2.2 by forcing core:1.26.0), Gradle extracts the AAR into core-1.26.0.aar/jni while the native build still looks for core-1.22.0.aar/jni, failing with: 'libarcore_sdk_c.so missing and no known rule to make it'. Resolve the actual extracted AAR via configurations.extractLibs and rewrite the -DARCORE_LIBPATH cmake argument to match the resolved version, with a graceful fallback to core-1.22.0.aar if resolution fails. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…project
ios/CMakeLists.txt hardcoded the iOS deployment target to 12 in two places:
- set(DEPLOYMENT_TARGET "12" CACHE STRING "") (line 12, consumed by the
leetal/ios-cmake toolchain to set CMAKE_OSX_DEPLOYMENT_TARGET)
- XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 12.0 on the BabylonNative target
Xcode 26's Clang crashes compiling DeviceImpl_iOS.mm against iOS 12, so
projects targeting iOS 16+ had to patch the deployment target from their
Podfile post_install hook.
Plumb a new BABYLON_IOS_DEPLOYMENT_TARGET environment variable from
postinstall.js into the CMake invocation (as -DDEPLOYMENT_TARGET=<value>)
and have CMakeLists.txt honour, in order: an explicit -DDEPLOYMENT_TARGET=,
the BABYLON_IOS_DEPLOYMENT_TARGET env var, then the historical 12 default.
Both DEPLOYMENT_TARGET and XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET now use
the resolved value, so the generated ReactNativeBabylon.xcodeproj matches
the consuming app's Podfile platform :ios setting without manual patching.
Documented in README.md alongside BABYLON_NO_CMAKE_POSTINSTALL and
BABYLON_USE_SYSTEM_CMAKE.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
iOS 12 is no longer a viable minimum: Xcode 26's Clang crashes while
compiling DeviceImpl_iOS.mm against the iOS 12 SDK, so consumers were
forced to override the deployment target via Podfile post_install or via
the BABYLON_IOS_DEPLOYMENT_TARGET env var introduced in the previous
commit. Bump the default everywhere so unmodified consumer projects work
out of the box on Xcode 26+:
- ios/CMakeLists.txt: DEPLOYMENT_TARGET default 12 -> 16 (still
overridable via -DDEPLOYMENT_TARGET= or BABYLON_IOS_DEPLOYMENT_TARGET).
- react-native-babylon.podspec: s.platforms ios 12.0 -> 16.0 so
CocoaPods enforces the new minimum on consuming apps.
- postinstall.js: update comment to reflect the new default.
- README.md: update iOS configuration section and the
BABYLON_IOS_DEPLOYMENT_TARGET docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both the implementation and �xtractLibs dependency declarations hardcoded com.google.ar:core:1.22.0. In practice this is harmless because Gradle's normal conflict resolution and any consumer-side resolutionStrategy.force on com.google.ar:core override the declared version, but it forced every consumer that wants a newer ARCore (e.g. to resolve the duplicate-class conflict between core:1.22 and installreferrer:2.2 requiring core:1.26+) to add a resolutionStrategy.force AND remember to keep the native build's ARCORE_LIBPATH in sync. Expose the ARCore version as a Gradle ext property using the existing safeExtGet helper, defaulting to 1.22.0 for backwards compatibility: ext.arcoreVersion = '1.26.0' // in the consumer's root build.gradle Use the variable in both implementation and �xtractLibs, in the cmake ARCORE_LIBPATH default, and in the dynamic-resolution fallback. The dynamic resolution (added previously) still picks up the actually-extracted AAR when a resolutionStrategy.force overrides the declared version, so both override mechanisms continue to work. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the defensive scaffolding (try/catch, group filter, manual index
loop with not-found fallback, status logger.warn) and use List.replaceAll
for the cmake-args mutation. Behaviour is unchanged: still resolves the
extractLibs configuration after the dependencies block (necessary because
the android { } block evaluates cmake.arguments before the dependencies
are declared further down in the script) and rewrites -DARCORE_LIBPATH to
match the actually-extracted AAR.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates Babylon React Native’s platform build configuration to (1) raise the minimum supported iOS deployment target to 16 and (2) make Android ARCore AAR/JNI path detection resilient to consumer-overridden ARCore versions.
Changes:
- Raise iOS minimum deployment target to 16.0 (docs + podspec) and add an env var override for the generated Xcode project deployment target.
- Add
ext.arcoreVersionsupport on Android and dynamically rewrite-DARCORE_LIBPATHto match the resolved ARCore AAR version. - Document
BABYLON_IOS_DEPLOYMENT_TARGETfor consumers.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Modules/@babylonjs/react-native/README.md | Updates iOS minimum target to 16 and documents BABYLON_IOS_DEPLOYMENT_TARGET. |
| Modules/@babylonjs/react-native/react-native-babylon.podspec | Raises CocoaPods minimum iOS platform version to 16.0. |
| Modules/@babylonjs/react-native/postinstall.js | Forwards BABYLON_IOS_DEPLOYMENT_TARGET to CMake when generating the iOS Xcode project. |
| Modules/@babylonjs/react-native/ios/CMakeLists.txt | Adds deployment target override logic and applies it to Xcode build settings. |
| Modules/@babylonjs/react-native/android/build.gradle | Introduces overrideable ARCore version + resolves actual extracted AAR name to set ARCORE_LIBPATH. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The @babylonjs/react-native podspec declares an iOS 16 minimum (matching the CMake-generated framework's default deployment target). The test app's Podfile relied on react-native-test-app's lower default, which caused 'pod install' to reject the local pod with Specs satisfying the react-native-babylon dependency were found, but they required a higher minimum deployment target.' Set the Podfile's platform explicitly to keep CI's Pods install in sync with the pod's minimum. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ryantrem
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.