Skip to content

Commit 8cfcbb8

Browse files
Kudograbbou
authored andcommitted
Fix ReactAndroid build break. (facebook#22377)
Summary: During C++ build, we need the libjsc.so. But arm64-v8a and x86_64 libjsc.so are in different path and this error raised: Android NDK: ERROR:/home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/Android.mk:jsc: LOCAL_SRC_FILES points to a missing file /opt/ndk/android-ndk-r17c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop. Android NDK: Check that /home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/arm64-v8a/libjsc.so exists or that its path is correct The commit moves prebuilt libjsc.so into ReactAndroid/src/main/jni/third-party/jsc/jni and let ndkbuild script find the prebuilt libjsc.so. For AAR packaging, modify the jniLibs so that gradle android library plugin could find the prebuilt libjsc.so as well. Pull Request resolved: facebook#22377 Differential Revision: D13166556 Pulled By: hramos fbshipit-source-id: 61daaede7defbc66491a3e2f20058e7d248ba13e
1 parent 780e193 commit 8cfcbb8

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

ReactAndroid/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ task prepareJSC(dependsOn: dependenciesPath ? [] : [downloadJSCHeaders]) << {
162162
copy {
163163
from zipTree(configurations.compile.fileCollection { dep -> dep.name == 'android-jsc' }.singleFile)
164164
from dependenciesPath ? "$dependenciesPath/jsc-headers" : {downloadJSCHeaders.dest}
165-
from 'src/main/jni/third-party/jsc/Android.mk'
165+
from 'src/main/jni/third-party/jsc'
166166
include 'jni/**/*.so', '*.h', 'Android.mk'
167167
filesMatching('*.h', { fname -> fname.path = "JavaScriptCore/${fname.path}"})
168168
into "$thirdPartyNdkDir/jsc";
@@ -289,7 +289,7 @@ android {
289289

290290
sourceSets.main {
291291
jni.srcDirs = []
292-
jniLibs.srcDir "$buildDir/react-ndk/exported"
292+
jniLibs.srcDirs = ["$buildDir/react-ndk/exported", 'src/main/jni/third-party/jsc/jni']
293293
res.srcDirs = ['src/main/res/devsupport', 'src/main/res/shell', 'src/main/res/views/modal', 'src/main/res/views/uimanager']
294294
java {
295295
srcDirs = ['src/main/java', 'src/main/libraries/soloader/java', 'src/main/jni/first-party/fb/jni/java']

0 commit comments

Comments
 (0)