Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,18 @@ def rnVersion = getRNVersion()
println "Found react native version as ${rnVersion}"

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
if (rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true") {
return true
}

def version = rnVersion.replaceAll(/[^0-9.]/, "")
def parts = version.tokenize('.')
if (parts.size() < 2) {
return false
}
def major = parts[0] as int
def minor = parts[1] as int
return (major > 0) || (major == 0 && minor >= 82)
}

apply plugin: 'com.android.library'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,21 @@ protected String getJSMainModuleName() {

@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
return true;
}

String version = BuildConfig.REACT_NATIVE_VERSION;
String[] parts = version.split("\\.");

if (parts.length < 2) {
return false;
}

int major = Integer.parseInt(parts[0]);
int minor = Integer.parseInt(parts[1]);

return major > 0 || (major == 0 && minor >= 82);
}

@Override
Expand Down