diff --git a/android/app/build.gradle b/android/app/build.gradle index 8b0f1de41..02b3fdb0b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -261,12 +261,9 @@ android { } } - // packagingOptions { - // pickFirst '**/armeabi-v7a/libc++_shared.so' - // pickFirst '**/x86/libc++_shared.so' - // pickFirst '**/arm64-v8a/libc++_shared.so' - // pickFirst '**/x86_64/libc++_shared.so' - // } + packagingOptions { + pickFirst '**/libc++_shared.so' + } // applicationVariants are e.g. debug, release @@ -352,6 +349,7 @@ android { dependencies { implementation project(':@react-native-community_viewpager') implementation "androidx.core:core-splashscreen:1.0.0" + implementation project(':watermelondb-jsi') playImplementation project(':react-native-notifications') playImplementation 'com.google.firebase:firebase-core:16.0.0' playImplementation project(':@react-native-firebase_app') diff --git a/android/app/src/main/java/chat/rocket/reactnative/MainApplication.java b/android/app/src/main/java/chat/rocket/reactnative/MainApplication.java index b94159e09..49b48c384 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/MainApplication.java +++ b/android/app/src/main/java/chat/rocket/reactnative/MainApplication.java @@ -19,6 +19,9 @@ import android.content.res.Configuration; import expo.modules.ApplicationLifecycleDispatcher; import expo.modules.ReactNativeHostWrapper; import java.lang.reflect.InvocationTargetException; +import com.facebook.react.bridge.JSIModuleSpec; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.JavaScriptContextHolder; import java.util.Arrays; import java.util.List; @@ -26,6 +29,8 @@ import java.util.List; import chat.rocket.reactnative.newarchitecture.MainApplicationReactNativeHost; import chat.rocket.reactnative.networking.SSLPinningPackage; +import com.nozbe.watermelondb.jsi.WatermelonDBJSIPackage; + public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(this, new ReactNativeHost(this) { @@ -52,7 +57,20 @@ public class MainApplication extends Application implements ReactApplication { @Override protected JSIModulePackage getJSIModulePackage() { - return new ReanimatedJSIModulePackage(); + return new JSIModulePackage() { + @Override + public List getJSIModules( + final ReactApplicationContext reactApplicationContext, + final JavaScriptContextHolder jsContext + ) { + List modules = Arrays.asList(); + + modules.addAll(new WatermelonDBJSIPackage().getJSIModules(reactApplicationContext, jsContext)); + modules.addAll(new ReanimatedJSIModulePackage().getJSIModules(reactApplicationContext, jsContext)); + + return modules; + } + }; } @Override diff --git a/android/settings.gradle b/android/settings.gradle index 7c04369ae..d88287a84 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -7,6 +7,8 @@ include ':@react-native-firebase_analytics' project(':@react-native-firebase_analytics').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/analytics/android') include ':@react-native-firebase_crashlytics' project(':@react-native-firebase_crashlytics').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/crashlytics/android') +include ':watermelondb-jsi' +project(':watermelondb-jsi').projectDir = new File(rootProject.projectDir, '../node_modules/@nozbe/watermelondb/native/android-jsi') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app'