Skip to content

Commit 1d49f4a

Browse files
fix: Adding version check for new arch
1 parent 2d98755 commit 1d49f4a

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

example/android/app/src/main/java/in/juspay/hypersdkreact/example/MainApplication.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,21 @@ protected String getJSMainModuleName() {
4747

4848
@Override
4949
protected boolean isNewArchEnabled() {
50-
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
50+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
51+
return true;
52+
}
53+
54+
String version = BuildConfig.REACT_NATIVE_VERSION;
55+
String[] parts = version.split("\\.");
56+
57+
if (parts.length < 2) {
58+
return false;
59+
}
60+
61+
int major = Integer.parseInt(parts[0]);
62+
int minor = Integer.parseInt(parts[1]);
63+
64+
return major > 0 || (major == 0 && minor >= 82);
5165
}
5266

5367
@Override

0 commit comments

Comments
 (0)