react-native-community / jsc-android-buildscripts

Script for building JavaScriptCore for Android (for React Native but not only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing libjsc.so in the arm64 build

rfestag opened this issue · comments

Issue Description

I playing with an example project that enables pnpm to be used with React Native (https://github.com/vjpr/pnpm-react-native-example). After manually installing @react-native-community/cli-platform-android, I was able to get it to build and install on my Pixel 3. Unfortunately, it immediately crashed.

Running adb logcat *:E gave me the following error:

2-28 11:16:49.986 25439 25439 E SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found: needed by /data/app/~~67CGxiQSd0m7OQ8TSCA2_g==/com.myproject-grXe2H7eonB2NHT7xx4TlQ==/lib/arm64/libjscexecutor.so in namespace classloader-namespace result: 0
02-28 11:16:50.239 25439 25489 E libc    : Access denied finding property "vendor.gralloc.disable_ahardware_buffer"
02-28 11:16:50.529  1061  6232 E statsd  : Stats puller failed for tag: 10038 at 1367719882693279
02-28 11:16:50.838  1061  6232 E statsd  : Gauge Stats puller failed for tag: 10062 at 1367719882693279
02-28 11:16:50.838  1061  6232 E statsd  : Gauge Stats puller failed for tag: 10063 at 1367719882693279
02-28 11:17:00.305 25439 25515 E SoLoader: couldn't find DSO to load: libhermes.so
02-28 11:17:00.305 25439 25515 E SoLoader: 	SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/user/0/com.myproject/lib-main flags = 1]
02-28 11:17:00.305 25439 25515 E SoLoader: 	SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~67CGxiQSd0m7OQ8TSCA2_g==/com.myproject-grXe2H7eonB2NHT7xx4TlQ==/lib/arm64 flags = 0]
02-28 11:17:00.305 25439 25515 E SoLoader: 	SoSource 2: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
02-28 11:17:00.305 25439 25515 E SoLoader: 	SoSource 3: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
02-28 11:17:00.305 25439 25515 E SoLoader: 	Native lib dir: /data/app/~~67CGxiQSd0m7OQ8TSCA2_g==/com.myproject-grXe2H7eonB2NHT7xx4TlQ==/lib/arm64
02-28 11:17:00.305 25439 25515 E SoLoader:  result: 0
02-28 11:17:00.308 25439 25515 E AndroidRuntime: FATAL EXCEPTION: create_react_context
02-28 11:17:00.308 25439 25515 E AndroidRuntime: Process: com.myproject, PID: 25439
02-28 11:17:00.308 25439 25515 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/user/0/com.myproject/lib-main flags = 1]
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~67CGxiQSd0m7OQ8TSCA2_g==/com.myproject-grXe2H7eonB2NHT7xx4TlQ==/lib/arm64 flags = 0]
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	SoSource 2: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	SoSource 3: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	Native lib dir: /data/app/~~67CGxiQSd0m7OQ8TSCA2_g==/com.myproject-grXe2H7eonB2NHT7xx4TlQ==/lib/arm64
02-28 11:17:00.308 25439 25515 E AndroidRuntime:  result: 0
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:896)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:725)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:649)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:629)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1017)
02-28 11:17:00.308 25439 25515 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:923)

I inspected the APK, and sure enough there was no libjsc.so in the arm64 build:

unzip -l ./android/app/build/outputs/apk/debug/app-debug.apk | grep jsc
   325784  1980-00-00 00:00   lib/arm64-v8a/libjscexecutor.so
 10163664  1980-00-00 00:00   lib/armeabi-v7a/libjsc.so
   259800  1980-00-00 00:00   lib/armeabi-v7a/libjscexecutor.so
 12688204  1980-00-00 00:00   lib/x86/libjsc.so
   321256  1980-00-00 00:00   lib/x86/libjscexecutor.so
 14051720  1980-00-00 00:00   lib/x86_64/libjsc.so
   342440  1980-00-00 00:00   lib/x86_64/libjscexecutor.so

Version, config, any additional info

It looks like React Native is pulling from the git repo, and was building against 245459.0.0. I was able to work around the issue by manually install jsc-android in my application, forcing me to fall back to 241213.1.0. I can only assume there are meaningful udpates/changes in the past 2 years, so it would be great if this could be resolved. I've seen a number of tickets referencing crashes with 245459.0.0, so perhaps this is related?

I have a similar issue with RN version 0.71.1, but libjsc.so is missing both for arm64-v8a and x86_64

unzip -l app-development-debug.apk | grep jsc
   302672  01-01-1981 01:01   lib/arm64-v8a/libjscexecutor.so
  1910900  01-01-1981 01:01   lib/armeabi-v7a/libjsc.so
   201624  01-01-1981 01:01   lib/armeabi-v7a/libjscexecutor.so
  4614240  01-01-1981 01:01   lib/x86/libjsc.so
   309484  01-01-1981 01:01   lib/x86/libjscexecutor.so
   307472  01-01-1981 01:01   lib/x86_64/libjscexecutor.so