react-native: Raise out android-jsc issues in current master
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info: System: OS: macOS 10.14 CPU: x64 Intel® Core™ i5-5287U CPU @ 2.90GHz Memory: 4.55 GB / 16.00 GB Shell: 5.6.2 - /usr/local/bin/zsh Binaries: Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node Yarn: 1.12.1 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: Build Tools: 21.1.2, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 27.0.0, 27.0.1, 27.0.3, 28.0.0, 28.0.2, 28.0.3 API Levels: 17, 19, 22, 23, 25, 26, 27, 28 IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild
Description
There are two issues for current approach of android-jsc adoption. Related to #18754.
-
The minSdkVersion is implicitly changed to API 21. Running on Android < 5 will have launch crash. Since this android-jsc is built by NDK APP_PLATFORM 21, there are some unresolved symbols for Android < 5 devices. E.g.
sigemptyset
-
Build break once published out as AAR format. Currently the dependency of android-jsc is added by this line.
compile project(':android-jsc')
For Android library as AAR, this dependency just tells the integrated application there is a ‘android-jsc’ package need to further resolved. Neither jar nor *.so will be packed into react-native AAR. User does not have android-jsc in their gradle projects, the dependency not found problem will cause build break. (Google plans to officially support fat aar in gradle plugin, which is fulfill this case to bundle all things in one AAR, but not ready yet.)
Reproducible Demo
- The minSdkVersion is implicitly changed to API 21.
Simply do
./gradlew :RNTester:android:app:installDebug
on Android 4.1 emulator and check adb log for missing symbols. E.g.
AndroidRuntime E FATAL EXCEPTION: create_react_context
E java.lang.ExceptionInInitializerError
E at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:25)
E at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:944)
E at java.lang.Thread.run(Thread.java:856)
E Caused by: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libjsc.so caused by: Can
not load library: reloc_library[1306]: 1138 cannot locate 'sigemptyset'...
E at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:703)
E at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:564)
E at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:500)
E at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:455)
E at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:30)
E at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:19)
E ... 3 more
- For RNTester to use AAR dependency.
- Apply this patch. Assume your $HOME is /Users/foo.
- Build AAR and deployed at mavenLocal:
./gradlew :ReactAndroid:uploadArchives
- Build RNTester:
./gradlew :RNTester:android:app:assembleDebug
- This is the build error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':RNTester:android:app:debugCompileClasspath'.
> Could not find react-native:android-jsc:unspecified.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- Fix jsc regression.Fixes #22274 (#22293) Summary: My silly mistake when tinkering with the jsc lib. Also you have this patch first https://github.com/facebook/react-native/pull/22295. Kudo plz review... — committed to facebook/react-native by gengjiawen 6 years ago
- Fix jsc regression.Fixes #22274 (#22293) Summary: My silly mistake when tinkering with the jsc lib. Also you have this patch first https://github.com/facebook/react-native/pull/22295. Kudo plz review... — committed to microsoft/react-native-macos by gengjiawen 6 years ago
- Fix jsc regression.Fixes #22274 (#22293) Summary: My silly mistake when tinkering with the jsc lib. Also you have this patch first https://github.com/facebook/react-native/pull/22295. Kudo plz review... — committed to microsoft/react-native-macos by gengjiawen 6 years ago
@Kudo Thanks. So the master branch actually won’t crash on pre-sdk-21 device. But I am intended to replace it with
jsc-android-buildscript
after https://github.com/react-community/jsc-android-buildscripts/pull/66 got merged.cc @DanielZlotin @dulmandakh @kelset