Skip to content

Commit 3ce6a35

Browse files
authored
Add support for RN 0.64+ (by excluding libturbomodulejsijni.so (#266)
1 parent caa566c commit 3ce6a35

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Modules/@babylonjs/react-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
},
3030
"peerDependencies": {
3131
"@babylonjs/core": "^5.0.0-alpha.34",
32-
"react": "^16.13.1",
33-
"react-native": "^0.63.1",
32+
"react": ">=16.13.1",
33+
"react-native": ">=0.63.1",
3434
"react-native-permissions": "^2.1.4"
3535
},
3636
"devDependencies": {

Package/Android/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def safeExtGet(prop, fallback) {
1919
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2020
}
2121

22+
def reactProperties = new Properties()
23+
file("$projectDir/../../../react-native/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
24+
def REACT_VERSION = reactProperties.getProperty("VERSION_NAME").split("\\.")[1].toInteger()
25+
2226
apply plugin: 'com.android.library'
2327
apply plugin: 'maven'
2428

@@ -59,6 +63,14 @@ android {
5963
}
6064
}
6165

66+
// The full/real version of libturbomodulejsijni.so will be built and included in apps using React Native 0.64 or newer,
67+
// so exclude Babylon React Native's minimal version of these libs in this case.
68+
if (REACT_VERSION >= 64) {
69+
android.packagingOptions.excludes += 'lib/armeabi-v7a/libturbomodulejsijni.so'
70+
android.packagingOptions.excludes += 'lib/arm64-v8a/libturbomodulejsijni.so'
71+
android.packagingOptions.excludes += 'lib/x86/libturbomodulejsijni.so'
72+
}
73+
6274
repositories {
6375
// ref: https://www.baeldung.com/maven-local-repository
6476
mavenLocal()

0 commit comments

Comments
 (0)