diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index e5ddb3471..522d7e0c3 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -137,6 +137,10 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + packagingOptions { + // Make sure libjsc.so does not packed in APK + exclude "**/libjsc.so" + } } dependencies { @@ -150,6 +154,8 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.facebook.react:react-native:+" // From node_modules + // Add v8-android - prebuilt libv8.so into APK + implementation 'org.chromium:v8-android:+' addUnimodulesDependencies() implementation project(":Lndmobile") diff --git a/mobile/android/build.gradle b/mobile/android/build.gradle index 73ae21eab..d44f2fd70 100644 --- a/mobile/android/build.gradle +++ b/mobile/android/build.gradle @@ -26,8 +26,12 @@ allprojects { google() jcenter() maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/../node_modules/react-native/android" + // Replace AAR from original RN with AAR from react-native-v8 + url("$rootDir/../node_modules/react-native-v8/dist") + } + maven { + // prebuilt libv8.so + url("$rootDir/../node_modules/v8-android/dist") } } } diff --git a/mobile/package-lock.json b/mobile/package-lock.json index 89073242e..9effd7ef0 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -5603,6 +5603,14 @@ "unimodules-task-manager-interface": "~3.0.0" } }, + "react-native-v8": { + "version": "0.59.10-patch.1", + "resolved": "https://registry.npmjs.org/react-native-v8/-/react-native-v8-0.59.10-patch.1.tgz", + "integrity": "sha512-8+VZKoxT/z4Sh+eqzEvinuVdA+IGIDU5IWnlU01EtgodIxpPqCVT7Z4cZtMfd+pVZZ90R/v3mHsXN13yLJXPNQ==", + "requires": { + "v8-android": "^7.5.1" + } + }, "react-navigation": { "version": "3.11.1", "resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-3.11.1.tgz", @@ -7048,6 +7056,11 @@ "resolved": "https://registry.npmjs.org/uuid-js/-/uuid-js-0.7.5.tgz", "integrity": "sha1-bIhtAqU9LUDc8l2RoXC0p7JblNA=" }, + "v8-android": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/v8-android/-/v8-android-7.5.1.tgz", + "integrity": "sha512-FFte/j4T8UtrEd6IB8hGFZS40+kTvgoSa/+krCTBbRPij18mez2CPGyfOa+sJdCSxuXGEj7g7pzOBdtqgzdqow==" + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", diff --git a/mobile/package.json b/mobile/package.json index 78d99a70f..5573f717e 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -28,6 +28,7 @@ "react-native-share": "^1.2.1", "react-native-svg": "^9.6.2", "react-native-unimodules": "^0.5.4", + "react-native-v8": "^0.59.10-patch.1", "react-navigation": "^3.11.1" }, "devDependencies": {