react-native-community / jsc-android-buildscripts Goto Github PK
View Code? Open in Web Editor NEWScript for building JavaScriptCore for Android (for React Native but not only)
License: BSD 2-Clause "Simplified" License
Script for building JavaScriptCore for Android (for React Native but not only)
License: BSD 2-Clause "Simplified" License
see facebook/react-native#22263.
Mostly maven give us the ability to replace jsc easier.
Thanks to everyone for working on this. It alleviates a huge pain in the RN community right now.
Is there any reason not to just run regular builds and publish them to public maven repos rather than have to build the deps at npm install
time?
If there's no reason not to, maybe we can run a job in a public CI tool like Travis that builds and pushes a new versioned package every week or somesuch?
Might have impact on some tests, we should strive to keep this as up-to-date as possible
Currently this is hardcoded pixel values matching the resolution and density of a PixelXL I used for tests. Might be able to calculate this from density with something like
adb shell wm size | grep -o -E '[0-9]+'
and
adb shell wm density | grep -o -E '[0-9]+'
In the instruction, it seems like I clone the repo in .
current directory.
Does it mean I can clone the repo anywhere I want and run the commands?
Thanks
Webkit people have told me that they would be okay with accepting patching that are JSCOnly port, because then upstream can do things like it will be possible to have buildbot and run tests, to prevent regressions.
We received a increase in crash reports from developers after releasing Expo with the new JSC (216113.0.2). The crashes are in JSStringCreateWithUTF8CString
so we suspect there is an issue inside of JSC. Unfortunately the crashes are non-deterministic.
Galaxy S7, API Level 23:
11-01 17:35:43.846: D/ReactNative(4011): Initializing React Xplat Bridge.
11-01 17:35:43.846: D/PermissionCache(3003): checking android.permission.READ_FRAME_BUFFER for uid=2000 => granted (252 us)
11-01 17:35:43.846: D/ReactNative(4011): Initializing React Xplat Bridge before initializeBridge
11-01 17:35:43.856: D/ReactNative(4011): Initializing React Xplat Bridge after initializeBridge
11-01 17:35:43.856: D/ReactNative(4011): CatalystInstanceImpl.runJSBundle()
11-01 17:35:43.856: D/ReactNative(4011): ReactInstanceManager.setupReactContext()
11-01 17:35:43.856: D/ReactNative(4011): CatalystInstanceImpl.initialize()
11-01 17:35:43.856: D/ReactNative(4011): ReactInstanceManager.attachRootViewToInstance()
11-01 17:35:43.866: W/unknown:Fresco(4011): Fresco has already been initialized! `Fresco.initialize(...)` should only be called 1 single time to avoid memory leaks!
11-01 17:35:43.866: D/b(4011): Do not have cached source file for https://d1wp6m56sqw74a.cloudfront.net/%40crash%2Fcrasher%2F1.0.4%2F06107da86759ea357eea8bb48bf0b65f-22.0.0-android.js
11-01 17:35:43.876: A/libc(4011): Fatal signal 7 (SIGBUS), code 2, fault addr 0xd2257416 in tid 4313 (mqt_js)
11-01 17:35:43.936: I/System.out(3959): INFO: New Screen: Optional.of(ScreenNode {Id=1, PackageName=com.crash.crasher, ActivityName=Optional.of(host.exp.exponent.experience.ShellAppActivity)})
11-01 17:35:43.936: A/DEBUG(3014): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-01 17:35:43.936: A/DEBUG(3014): Build fingerprint: 'samsung/heroltexx/herolte:6.0.1/MMB29K/G930FXXS1APG3:user/release-keys'
11-01 17:35:43.936: A/DEBUG(3014): Revision: '8'
11-01 17:35:43.936: A/DEBUG(3014): ABI: 'arm'
11-01 17:35:43.936: A/DEBUG(3014): pid: 4011, tid: 4313, name: mqt_js >>> com.crash.crasher <<<
11-01 17:35:43.936: D/CustomFrequencyManagerService(3357): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1872000 uid : 1000 pid : 3357 tag : ACTIVITY_RESUME_BOOSTER@9
11-01 17:35:43.936: A/DEBUG(3014): signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0xd2257416
11-01 17:35:43.946: D/MdnieScenarioControlService(3357): packageName : com.crash.crasher className : host.exp.exponent.experience.ShellAppActivity
11-01 17:35:43.986: A/DEBUG(3014): r0 0000007f r1 d23fd458 r2 0000fffd r3 d0d868b0
11-01 17:35:43.986: A/DEBUG(3014): r4 d2257416 r5 00000000 r6 00000000 r7 00000062
11-01 17:35:43.986: A/DEBUG(3014): r8 00000001 r9 00000062 sl d0a3a82c fp 00000000
11-01 17:35:43.986: A/DEBUG(3014): ip 00000003 sp d3a6fb54 lr 00000062 pc d559ed14 cpsr 800d0030
11-01 17:35:43.986: A/DEBUG(3014): backtrace:
11-01 17:35:43.986: A/DEBUG(3014): #00 pc 003c0d14 /data/app/com.crash.crasher-1/lib/arm/libjsc.so
11-01 17:35:43.986: A/DEBUG(3014): #01 pc 000307cf /data/app/com.crash.crasher-1/lib/arm/libjsc.so (JSStringCreateWithUTF8CString+104)
11-01 17:35:43.986: A/DEBUG(3014): #02 pc 0003018f /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so (_ZN8facebook5react11JSCExecutor11adoptStringESt10unique_ptrIKNS0_11JSBigStringESt14default_deleteIS4_EE+42)
11-01 17:35:43.986: A/DEBUG(3014): #03 pc 00030ff9 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so (_ZN8facebook5react11JSCExecutor21loadApplicationScriptESt10unique_ptrIKNS0_11JSBigStringESt14default_deleteIS4_EESs+140)
11-01 17:35:43.986: A/DEBUG(3014): #04 pc 00033bf3 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so
11-01 17:35:43.986: A/DEBUG(3014): #05 pc 000336e1 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so
11-01 17:35:43.986: A/DEBUG(3014): #06 pc 00016125 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so (_ZNKSt8functionIFvvEEclEv+12)
11-01 17:35:43.986: A/DEBUG(3014): #07 pc 0001de15 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so
11-01 17:35:43.986: A/DEBUG(3014): #08 pc 00016125 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so (_ZNKSt8functionIFvvEEclEv+12)
11-01 17:35:43.986: A/DEBUG(3014): #09 pc 00017da9 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so
11-01 17:35:43.986: A/DEBUG(3014): #10 pc 00017de7 /data/app/com.crash.crasher-1/lib/arm/libreactnativejni_abi22_0_0.so
11-01 17:35:43.986: A/DEBUG(3014): #11 pc 01cdfe4f /data/app/com.crash.crasher-1/oat/arm/base.odex (offset 0x1cdc000)
Nexus 5, Virtual, API Level 19:
11-01 20:36:08.224: D/ReactNative(5467): Initializing React Xplat Bridge after initializeBridge
11-01 20:36:08.224: D/ReactNative(5467): CatalystInstanceImpl.runJSBundle()
11-01 20:36:08.224: A/libc(5467): Fatal signal 11 (SIGSEGV) at 0x747fe000 (code=2), thread 5572 (mqt_js)
11-01 20:36:08.224: D/ReactNative(5467): ReactInstanceManager.setupReactContext()
11-01 20:36:08.224: D/ReactNative(5467): CatalystInstanceImpl.initialize()
11-01 20:36:08.234: D/ReactNative(5467): ReactInstanceManager.attachRootViewToInstance()
11-01 20:36:08.234: D/dalvikvm(5467): Trying to load lib /data/app-lib/com.crash.crasher-1/libyoga_abi22_0_0.so 0x950806f8
11-01 20:36:08.234: D/dalvikvm(5467): Added shared lib /data/app-lib/com.crash.crasher-1/libyoga_abi22_0_0.so 0x950806f8
11-01 20:36:08.234: W/unknown:Fresco(5467): Fresco has already been initialized! `Fresco.initialize(...)` should only be called 1 single time to avoid memory leaks!
11-01 20:36:08.244: D/dalvikvm(5440): GC_CONCURRENT freed 1K, 3% free 12783K/13116K, paused 3ms+13ms, total 21ms
11-01 20:36:08.244: I/System.out(5440): INFO: New Screen: Optional.of(ScreenNode {Id=1, PackageName=com.crash.crasher, ActivityName=Optional.of(host.exp.exponent.experience.ShellAppActivity)})
11-01 20:36:08.304: I/GceGrallocRegionRegistry(1329): Mapped gralloc-1329.33 hnd=0xb976fc80 fd=37 base=0xaf2d9000 format=RGBA_8888(0x1) width=1080 height=1776
11-01 20:36:08.304: I/GceGrallocRegionRegistry(5467): Mapped gralloc-1329.33 hnd=0xb7e5cc80 fd=122 base=0x72c9f000 format=RGBA_8888(0x1) width=1080 height=1776
11-01 20:36:08.324: I/DEBUG(1327): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-01 20:36:08.324: I/DEBUG(1327): Build fingerprint: 'generic/gce_x86_phone/gce_x86:4.4.4/KTU84P.KXG52/3751183:userdebug/test-keys'
11-01 20:36:08.324: I/DEBUG(1327): Revision: '0'
11-01 20:36:08.324: I/DEBUG(1327): pid: 5467, tid: 5572, name: mqt_js >>> com.crash.crasher <<<
11-01 20:36:08.324: I/DEBUG(1327): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 747fe000
11-01 20:36:08.974: I/Remoter(1337): Saved screenshot to '/data/screenshots/__pmv__-0118.jpg'
11-01 20:36:10.074: I/Remoter(1337): Saved screenshot to '/data/screenshots/__pmv__-0119.jpg'
11-01 20:36:10.334: E/NativeCrashListener(1706): Exception dealing with report
11-01 20:36:10.334: E/NativeCrashListener(1706): libcore.io.ErrnoException: read failed: EAGAIN (Try again)
11-01 20:36:10.334: E/NativeCrashListener(1706): at libcore.io.Posix.readBytes(Native Method)
11-01 20:36:10.334: E/NativeCrashListener(1706): at libcore.io.Posix.read(Posix.java:128)
11-01 20:36:10.334: E/NativeCrashListener(1706): at libcore.io.BlockGuardOs.read(BlockGuardOs.java:149)
11-01 20:36:10.334: E/NativeCrashListener(1706): at com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)
11-01 20:36:10.334: E/NativeCrashListener(1706): at com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)
11-01 20:36:10.484: I/DEBUG(1327): eax 747fe000 ebx 78105ff4 ecx 746c0010 edx 00000000
11-01 20:36:10.484: I/DEBUG(1327): AM write failure (32 / Broken pipe)
11-01 20:36:10.484: I/DEBUG(1327): esi 76e64858 edi 739ec0d0
11-01 20:36:10.484: I/DEBUG(1327): xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b
11-01 20:36:10.484: I/DEBUG(1327): eip b76befb0 ebp 746c0000 esp 76e63fac flags 00210246
11-01 20:36:10.484: E/Corkscrew(1327): unrecognized dwarf lower part encoding: 0xe5
11-01 20:36:10.484: I/DEBUG(1327): backtrace:
11-01 20:36:10.484: I/DEBUG(1327): #00 pc 00040fb0 /system/lib/libc.so (strlen+496)
11-01 20:36:10.484: I/DEBUG(1327): #01 pc 0003c376 /data/app-lib/com.crash.crasher-1/libjsc.so (JSStringCreateWithUTF8CString+54)
11-01 20:36:10.484: I/DEBUG(1327): #02 pc 0005f19f /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so (facebook::react::JSCExecutor::adoptString(std::unique_ptr<facebook::react::JSBigString const, std::default_delete<facebook::react::JSBigString const> >)+111)
11-01 20:36:10.484: I/DEBUG(1327): #03 pc 00060a22 /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so (facebook::react::JSCExecutor::loadApplicationScript(std::unique_ptr<facebook::react::JSBigString const, std::default_delete<facebook::react::JSBigString const> >, std::string)+226)
11-01 20:36:10.484: I/DEBUG(1327): stack:
11-01 20:36:10.484: I/DEBUG(1327): 76e63f6c 77f31a0c /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): 76e63f70 00000026
11-01 20:36:10.484: I/DEBUG(1327): 76e63f74 739f5be0
11-01 20:36:10.484: I/DEBUG(1327): 76e63f78 fffffffb
11-01 20:36:10.484: I/DEBUG(1327): 76e63f7c 0000000e
11-01 20:36:10.484: I/DEBUG(1327): 76e63f80 00000000
11-01 20:36:10.484: I/DEBUG(1327): 76e63f84 769fc980
11-01 20:36:10.484: I/DEBUG(1327): 76e63f88 00000069
11-01 20:36:10.484: I/DEBUG(1327): 76e63f8c 77f4f22e /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): 76e63f90 769fc990
11-01 20:36:10.484: I/DEBUG(1327): 76e63f94 b7d68c3c [heap]
11-01 20:36:10.484: I/DEBUG(1327): 76e63f98 00000069
11-01 20:36:10.484: I/DEBUG(1327): 76e63f9c 77d5a3c9 /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): 76e63fa0 00000000
11-01 20:36:10.484: I/DEBUG(1327): 76e63fa4 00000000
11-01 20:36:10.484: I/DEBUG(1327): 76e63fa8 77f6451c /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): #00 76e63fac 779ec377 /data/app-lib/com.crash.crasher-1/libjsc.so (JSStringCreateWithUTF8CString+55)
11-01 20:36:10.484: I/DEBUG(1327): #01 76e63fb0 746c0000 /data/data/com.crash.crasher/files/22.0.0/cached-bundle-experience-%40crash%2Fcrasher-1657472164-22.0.0
11-01 20:36:10.484: I/DEBUG(1327): 76e63fb4 78105ff4 /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): 76e63fb8 78105ff4 /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): 76e63fbc 779ec366 /data/app-lib/com.crash.crasher-1/libjsc.so (JSStringCreateWithUTF8CString+38)
11-01 20:36:10.484: I/DEBUG(1327): 76e63fc0 76e63fd0 [stack:5572]
11-01 20:36:10.484: I/DEBUG(1327): 76e63fc4 b7d68c3c [heap]
11-01 20:36:10.484: I/DEBUG(1327): 76e63fc8 00000069
11-01 20:36:10.484: I/DEBUG(1327): 76e63fcc 746c0000 /data/data/com.crash.crasher/files/22.0.0/cached-bundle-experience-%40crash%2Fcrasher-1657472164-22.0.0
11-01 20:36:10.484: I/DEBUG(1327): 76e63fd0 00000000
11-01 20:36:10.484: I/DEBUG(1327): 76e63fd4 769dbff0
11-01 20:36:10.484: I/DEBUG(1327): 76e63fd8 78105ff4 /data/app-lib/com.crash.crasher-1/libjsc.so
11-01 20:36:10.484: I/DEBUG(1327): 76e63fdc 779ec41e /data/app-lib/com.crash.crasher-1/libjsc.so (JSStringCreateWithUTF8CString+222)
11-01 20:36:10.484: I/DEBUG(1327): 76e63fe0 769dbff4
11-01 20:36:10.484: I/DEBUG(1327): 76e63fe4 b7d68c3c [heap]
11-01 20:36:10.484: I/DEBUG(1327): 76e63fe8 00000069
11-01 20:36:10.484: I/DEBUG(1327): 76e63fec 779ec366 /data/app-lib/com.crash.crasher-1/libjsc.so (JSStringCreateWithUTF8CString+38)
11-01 20:36:10.484: I/DEBUG(1327): ........ ........
11-01 20:36:10.484: I/DEBUG(1327): #02 76e647f0 746c0000 /data/data/com.crash.crasher/files/22.0.0/cached-bundle-experience-%40crash%2Fcrasher-1657472164-22.0.0
11-01 20:36:10.484: I/DEBUG(1327): 76e647f4 b7d68ca5 [heap]
11-01 20:36:10.484: I/DEBUG(1327): 76e647f8 76e6480f [stack:5572]
11-01 20:36:10.484: I/DEBUG(1327): 76e647fc 782cb0f3 /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so (facebook::react::ReactMarker::logMarker(facebook::react::ReactMarker::ReactMarkerId)+51)
11-01 20:36:10.484: I/DEBUG(1327): 76e64800 782f1a18 /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so
11-01 20:36:10.484: I/DEBUG(1327): 76e64804 00000005
11-01 20:36:10.484: I/DEBUG(1327): 76e64808 782c2139 /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so (facebook::react::JSCExecutor::adoptString(std::unique_ptr<facebook::react::JSBigString const, std::default_delete<facebook::react::JSBigString const> >)+9)
11-01 20:36:10.484: I/DEBUG(1327): 76e6480c 782f0c4c /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so
11-01 20:36:10.484: I/DEBUG(1327): 76e64810 769dbff0
11-01 20:36:10.484: I/DEBUG(1327): 76e64814 76e64898 [stack:5572]
11-01 20:36:10.484: I/DEBUG(1327): 76e64818 76e64878 [stack:5572]
11-01 20:36:10.484: I/DEBUG(1327): 76e6481c 782c3a23 /data/app-lib/com.crash.crasher-1/libreactnativejni_abi22_0_0.so (facebook::react::JSCExecutor::loadApplicationScript(std::unique_ptr<facebook::react::JSBigString const, std::default_delete<facebook::react::JSBigString const> >, std::string)+227)
11-01 20:36:10.484: I/DEBUG(1327): 76e64820 76e64858 [stack:5572]
11-01 20:36:10.484: I/DEBUG(1327): 76e64824 b7ea7020 [heap]
11-01 20:36:10.484: I/DEBUG(1327): 76e64828 76e64854 [stack:5572]
11-01 20:36:10.484: I/DEBUG(1327): 76e6482c ffffffff
11-01 20:36:10.484: I/DEBUG(1327): memory map around fault addr 747fe000:
11-01 20:36:10.484: I/DEBUG(1327): 746c0000-747fe000 r-- /data/data/com.crash.crasher/files/22.0.0/cached-bundle-experience-%40crash%2Fcrasher-1657472164-22.0.0
11-01 20:36:10.484: I/DEBUG(1327): 747fe000-747ff000 ---
11-01 20:36:10.484: I/DEBUG(1327): 747ff000-74802000 rwx
Running on a custom compiled react-native based on 0.51.0 version for x64 Android.
Once the bundle is loaded about 50% of times crashes with:
libc F Fatal signal 11 (SIGSEGV), code 1, fault addr 0x100000008 in tid 2215 (mqt_js), pid 2168 (wix.android.dev)
DEBUG F *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F Build fingerprint:
F Revision: '0'
F ABI: 'arm64'
F pid: 2168, tid: 2215, name: mqt_js >>> com.wix.android.dev <<<
F signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x100000008
F x0 0000007c6789c0a0 x1 0000007c68000000 x2 0000007c678cb258 x3 0000007c6caf7ee8
F x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 0000000000000000
F x8 0000000000000530 x9 0000000000000006 x10 0000000100000000 x11 0000000000000001
F x12 00000000cf1841c8 x13 0000000000000005 x14 000000000000007c x15 0000000000000001
F x16 0000000003010069 x17 0000000000000000 x18 0000000000000002 x19 0000007c6caf7ee8
F x20 0000007c68000000 x21 0000000000000000 x22 0000007c6789c0a0 x23 000000000301006a
F x24 000000000000007c x25 00000000cf1841c9 x26 0000000300000000 x27 0000007c61c27008
F x28 0000000000000002 x29 0000007c6caf8480 x30 0000007c6db57938
F sp 0000007c6caf7d80 pc 0000007c6db83294 pstate 0000000020000000
F backtrace:
F #00 pc 0000000000102294 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so
F #01 pc 00000000000d6934 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so
F #02 pc 00000000004e4474 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so
F #03 pc 00000000004e4890 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so
F #04 pc 00000000001d2fe4 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so
F #05 pc 00000000003ac8bc /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so
F #06 pc 000000000006601c /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libjsc.so (JSEvaluateScript+480)
F #07 pc 0000000000071f84 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so (facebook::react::evaluateScript(OpaqueJSContext const*, OpaqueJS
String*, OpaqueJSString*)+56)
F #08 pc 0000000000063a58 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so (facebook::react::JSCExecutor::loadApplicationScript(std::__ndk1:
:unique_ptr<facebook::react::JSBigString const, std::__ndk1::default_delete<facebook::react::JSBigString const>>, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>
, std::__ndk1::allocator<char>>)+632)
F #09 pc 000000000006dd00 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so
F #10 pc 000000000006eea0 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so
F #11 pc 0000000000034368 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so
F #12 pc 00000000000216cc /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so
F #13 pc 0000000000021648 /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/lib/arm64/libreactnativejni.so
F #14 pc 000000000003fa9c /data/app/com.wix.android.dev-mImsHlIhdjuBhFAgfqjh4g==/oat/arm64/base.odex (offset 0x39000)
I can't seem to reproduce it in our measure app, just in the Wix app (which is very big)
Makes no sense to change package.json to build with/without i18n. Should always build all variants for all architectures. We bundle everything together anyway.
Provide an easy way to build just 1 arch in 1 variant if possible.
First of all, I appreciate the effort put in this by Expo and Software Mansion engineers.
I wanted to ask the future plans for this repo. Do you intend to replace android-jsc at any point? In other words, are you collaborating with FB devs to make this (the smaller, non-intl variant) the standard JavaScript engine on React Native Android, without requiring the patches?
If so, is there a timeline set, such as a certain version of React Native will start using this project? If not, why not?
Also, an unrelated question. Your project description states:
Script for building JavaScriptCore for Android (for React Native but not only)
How does this "not only" part work? As far as I see you're creating .so files, not a Java library. So if I'd like to use this as a standalone JavaScript engine one day, do you expect me to write C++ code for the integration? This part can require quite an expertise, as I imagine most JavaScript and/or Android devs are not familiar with C++ in their daily work (me included).
I integrated JSC to my react-native project following the directions found in the README.
I used the intl flavour, as my app needs to support multiple languages and locales.
The app runs fine, so it appears the integration of the newer JSC went off without a hitch.
However, the following block of code will throw the exception Error: Failed to format a number.
:
const fmtLocale = `en-US`;
const fmtOpts = { minimumFractionDigits: 2, maximumFractionDigits: 2 };
const numberFormat = new Intl.NumberFormat(fmtLocale, fmtOpts);
const formatted = numberFormat.format(1.25);
That block of code runs without a hitch on the JSC which comes with react-native by default.
And note that the line that is throwing is the call to numberFormat.format(1.25)
; the Intl
object has all the expected members, and said members instantiate without an exceptions being generated (so I don't believe its an issue of mistakenly using the non-intl
flavor of JSC...)
react-native
v0.54.4jsc-android
v224109.0.0 (with android-jsc
being forced to android-jsc-intl
r224109
)If any other pertinent information comes to mind, I'll be sure to update; otherwise if any more info is needed, or you'd like me to put together a repo with a minimum reproduction, I'm happy to provide greater detail.
This issue may be related to #36 and #47.
Edit: added some clarifications.
Pulling the 1.1 version through npm (npm i jsc-android) has 1985 as the year on most files, e.g.:
26 Oct 1985 LICENSE
26 Oct 1985 README.md
MacOS Maverick, Ubuntu 16.04
Following the installation instructions (not using Docker), I got to the step to run all.sh
and got the following error:
➜ jsc-android-buildscripts git:(master) ✗ ./all.sh
=== compiling toolchain ===
=== compiling icu ===
./icu.sh: line 16: realpath: command not found
I'm on macOS Sierra 10.12.6.
The release build crashes after 10-15 seconds.
Also I have to mention there is a pre-login set of screens, and post-login set which is bit more complex. No matter however long I stay inside the pre-login screen it does not crash. Once I login and enter, after about 10secs it crashes.
It is only the release build that crashes and not debug so I was not able to gather much info, other than just the log. I will work on getting any more info.
--------- beginning of crash
2018-12-03 10:12:18.964 5226-5096/? A/google-breakpad: Microdump skipped (uninteresting)
2018-12-03 10:12:18.998 5020-5096/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2018-12-03 10:12:18.998 5020-5096/? W/google-breakpad: Chrome build fingerprint:
2018-12-03 10:12:18.998 5020-5096/? W/google-breakpad: 70.0.3538.110
2018-12-03 10:12:18.998 5020-5096/? W/google-breakpad: 353811052
2018-12-03 10:12:18.998 5020-5096/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2018-12-03 10:12:18.999 5020-5096/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x117 in tid 5096 (mqt_js), pid 5020 (dus.live.mobile)
2018-12-03 10:12:19.179 5229-5229/? I/crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2018-12-03 10:12:19.180 2057-2057/? I//system/bin/tombstoned: received crash request for pid 5020
2018-12-03 10:12:19.182 5229-5229/? I/crash_dump32: performing dump of process 5020 (target tid = 5096)
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: Build fingerprint: 'Nokia/TA-1053_00WW/ND1:8.1.0/OPR1.170623.026/00WW_5_63E:user/release-keys'
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: Revision: '0'
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: ABI: 'arm'
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: pid: 5020, tid: 5096, name: mqt_js >>> com.telldus.live.mobile <<<
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x117
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: Cause: null pointer dereference
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: r0 b9d868e0 r1 fffffffb r2 00000117 r3 fffffffb
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: r4 b9fbf140 r5 c9d5083d r6 cc1c95ff r7 caf7c458
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: r8 c3cd9034 r9 c1004a38 sl caf7c320 fp ee01e631
2018-12-03 10:12:19.183 5229-5229/? A/DEBUG: ip fffffef8 sp caf7c350 lr c9eef5f5 pc c9eef61e cpsr a00d0030
2018-12-03 10:12:19.184 5229-5229/? A/DEBUG: backtrace:
2018-12-03 10:12:19.184 5229-5229/? A/DEBUG: #00 pc 000b261e <anonymous:c9e3d000>
2018-12-03 10:12:19.184 5229-5229/? A/DEBUG: #01 pc 000b25f3 <anonymous:c9e3d000>
2018-12-03 10:12:19.914 2508-3724/? D/WifiTrafficPoller: packet count Tx=1742122 Rx=3380258
2018-12-03 10:12:19.916 3763-3763/? D/NetworkController.WifiSignalController: Change in state from: connected=true,enabled=true,level=4,inetCondition=1,iconGroup=IconGroup(Wi-Fi Icons),activityIn=true,activityOut=true,rssi=-25,lastModified=12-03 10:12:14,ssid="rimz-home",isTransient=false
to: connected=true,enabled=true,level=4,inetCondition=1,iconGroup=IconGroup(Wi-Fi Icons),activityIn=false,activityOut=false,rssi=-25,lastModified=12-03 10:12:14,ssid="rimz-home",isTransient=false
2018-12-03 10:12:19.921 3763-3763/? D/Tile.WifiTile: onWifiSignalChanged enabled=true
2018-12-03 10:12:19.922 3763-3895/? D/Tile.WifiTile: handleUpdateState arg=CallbackInfo[enabled=true,connected=true,wifiSignalIconId=2131231168,enabledDesc="rimz-home",activityIn=false,activityOut=false,wifiSignalContentDescription=Wi-Fi signal full.,isTransient=false]
2018-12-03 10:12:20.644 563-580/? I/mmid: select timeout: wait for receiving msg
2018-12-03 10:12:20.916 2508-3724/? D/WifiTrafficPoller: packet count Tx=1742122 Rx=3380258
2018-12-03 10:12:21.918 2508-3724/? D/WifiTrafficPoller: packet count Tx=1742122 Rx=3380258
2018-12-03 10:12:22.350 3932-3932/? W/ResourceType: No package identifier when getting value for resource number 0x00000000
2018-12-03 10:12:22.351 3763-3895/? D/NetworkController.MobileSignalController(2): updateTelephony: hasService=true ss=SignalStrength: 99 0 -120 -160 -120 -1 -1 15 -114 -15 74 2147483647 0 2147483647 gsm|lte 99 99
2018-12-03 10:12:22.352 3763-3895/? I/NetworkController.MobileSignalController(2): updateVoiceNetworkType voiceNetType: 13 mCurrentState.connected: true
2018-12-03 10:12:22.354 3763-3895/? I/NetworkController.MobileSignalController(2): isShowSXLTEStyle: false isRoaming: false
2018-12-03 10:12:22.658 2057-2057/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_02
react: 16.6.1
react-native: 0.57.7
Node: 10.13.0
Yarn: 1.12.3
npm: 6.4.1
Android OS: 8.1.0
Thanks!
We're seeing some crashes with the new version of JSC:
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libjsc.so" needed by "libreactnativejni.so"; caused by cannot locate symbol "signal" referenced by "libjsc.so"...
at java.lang.Runtime.load(Runtime.java:333)
at java.lang.System.load(System.java:512)
at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:71)
at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:42)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:299)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:247)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:17)
at com.facebook.react.bridge.NativeMap.(NativeMap.java)
at com.facebook.react.bridge.Arguments.createMap(Arguments.java:164)
at host.exp.exponent.gcm.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:77)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Google devices appear to be fine. We're seeing over half of the crashes from Samsung devices, 7% from Asus, 4% from Rockchip, and 4% from Huawei. We're also seeing it crash in Genymotion as well.
This is on a Nexus 5X device with Android 8.0.0 using the default (non-intl) variant of Android JSC from npm (version 216113.0.2):
10-23 11:25:38.728 23404 23601 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 23601 (mqt_js)
10-23 11:25:38.858 23615 23615 I crash_dump32: obtaining output fd from tombstoned
10-23 11:25:38.859 3179 3179 I /system/bin/tombstoned: received crash request for pid 23404
10-23 11:25:38.860 23615 23615 I crash_dump32: performing dump of process 23404 (target tid = 23601)
10-23 11:25:38.860 23615 23615 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-23 11:25:38.860 23615 23615 F DEBUG : Build fingerprint: 'google/bullhead/bullhead:8.0.0/OPR4.170623.009/4302492:user/release-keys'
10-23 11:25:38.860 23615 23615 F DEBUG : Revision: 'rev_1.0'
10-23 11:25:38.860 23615 23615 F DEBUG : ABI: 'arm'
10-23 11:25:38.861 23615 23615 F DEBUG : pid: 23404, tid: 23601, name: mqt_js >>> host.exp.exponent <<<
10-23 11:25:38.861 23615 23615 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
10-23 11:25:38.861 23615 23615 F DEBUG : Cause: null pointer dereference
10-23 11:25:38.861 23615 23615 F DEBUG : r0 00000000 r1 00000000 r2 ffffffff r3 00000000
10-23 11:25:38.861 23615 23615 F DEBUG : r4 00000000 r5 00000075 r6 000007e1 r7 badf6f28
10-23 11:25:38.861 23615 23615 F DEBUG : r8 badf6f28 r9 ffffc000 sl 00000000 fp 00000003
10-23 11:25:38.861 23615 23615 F DEBUG : ip ea55a594 sp badf6e28 lr ea511c0f pc ea4e5058 cpsr 600d0030
10-23 11:25:38.863 23615 23615 F DEBUG :
10-23 11:25:38.863 23615 23615 F DEBUG : backtrace:
10-23 11:25:38.863 23615 23615 F DEBUG : #00 pc 0001a058 /system/lib/libc.so (strlen+71)
10-23 11:25:38.863 23615 23615 F DEBUG : #01 pc 00046c0b /system/lib/libc.so (strdup+4)
10-23 11:25:38.863 23615 23615 F DEBUG : #02 pc 00263a83 /data/app/host.exp.exponent-ljO9iYhXrF-kIrYLcXEUKQ==/lib/arm/libjsc.so
10-23 11:25:38.863 23615 23615 F DEBUG : #03 pc 002639b9 /data/app/host.exp.exponent-ljO9iYhXrF-kIrYLcXEUKQ==/lib/arm/libjsc.so
10-23 11:25:38.863 23615 23615 F DEBUG : #04 pc 0017ac87 <anonymous:c5fff000>
Repro: run new Date().toLocaleString()
in a project.
react-native version : 0.48.1
jsc installed via "jsc-android": "^216113.0.2",
in package.json
This app starts and runs in iOS just fine, and also in the debugger, but it was failing on Android due to a lack of real Uint8Array. That's why we were hoping to upgrade jsc.
Upon executing via react-native run-android
I get this error at startup. I am presently attempting to build a debug version of the lib in order to get a better stack trace (any tips would be appreciated) . This happens in either the emulator or a phone.
09-20 13:20:15.303 5513 5545 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 5545 (mqt_js)
09-20 13:20:15.304 1263 1263 W : debuggerd: handling request: pid=5513 uid=10084 gid=10084 tid=5545
09-20 13:20:15.312 5559 5559 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-20 13:20:15.312 5559 5559 F DEBUG : Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:7.1.1/NYC/4252396:userdebug/test-keys'
09-20 13:20:15.312 5559 5559 F DEBUG : Revision: '0'
09-20 13:20:15.312 5559 5559 F DEBUG : ABI: 'x86'
09-20 13:20:15.313 5559 5559 F DEBUG : pid: 5513, tid: 5545, name: mqt_js >>> com.mobilemessenger <<<
09-20 13:20:15.313 5559 5559 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
09-20 13:20:15.313 5559 5559 F DEBUG : eax 00000000 ebx a61ac7b8 ecx 00000000 edx 00000000
09-20 13:20:15.313 5559 5559 F DEBUG : esi 00000075 edi 000007e1
09-20 13:20:15.313 5559 5559 F DEBUG : xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
09-20 13:20:15.313 5559 5559 F DEBUG : eip a60f07c2 ebp 8b26f2b8 esp 8b26f28c flags 00010283
09-20 13:20:15.315 5559 5559 F DEBUG :
09-20 13:20:15.315 5559 5559 F DEBUG : backtrace:
09-20 13:20:15.315 5559 5559 F DEBUG : #00 pc 0001c7c2 /system/lib/libc.so (strlen+18)
09-20 13:20:15.315 5559 5559 F DEBUG : #01 pc 00084360 /system/lib/libc.so (__strlen_chk+32)
09-20 13:20:15.315 5559 5559 F DEBUG : #02 pc 000731aa /system/lib/libc.so (strdup+42)
09-20 13:20:15.315 5559 5559 F DEBUG : #03 pc 0038f47e /data/app/com.mobilemessenger-1/lib/x86/libjsc.so
09-20 13:20:15.315 5559 5559 F DEBUG : #04 pc 0038f335 /data/app/com.mobilemessenger-1/lib/x86/libjsc.so
09-20 13:20:15.315 5559 5559 F DEBUG : #05 pc 0005e0fc <anonymous:88bff000>
09-20 13:20:15.841 1677 5564 W ActivityManager: Force finishing activity com.mobilemessenger/.MainActivity
Some info is missing from the table. Also, the table should mention npm version and other maybe the percent improvement from stock react-native
I found a crash on release version and want to use "arm-linux-androideabi-addr2line" to check the source code. How to build the library with source-level debug information?
Not good at english, wish this is clear. Thanks!
macOS High Sierra
Version 10.13.6 (17G65)
In the measure app:
const opts = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
const date = new Date();
const he = date.toLocaleDateString('he', opts);
Crashes:
AndroidRuntime E FATAL EXCEPTION: mqt_native_modules
E Process: com.javascriptcore.profiler, PID: 32127
E com.facebook.react.common.JavascriptException: failed to initialize DateTimeFormat, stack:
E value@13:525
E value@205:621
E close@204:270
E closeAll@190:1249
E perform@190:683
E a@182:234
E perform@190:596
E renderComponent@182:1123
E r@360:116
E runApplication@357:1951
E value@44:2877
E <unknown>@44:818
E value@44:2278
E value@44:790
E at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:99)
E at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:83)
E at java.lang.reflect.Method.invoke(Native Method)
E at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:368)
E at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:138)
E at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
E at android.os.Handler.handleCallback(Handler.java:790)
E at android.os.Handler.dispatchMessage(Handler.java:99)
E at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
E at android.os.Looper.loop(Looper.java:164)
E at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208)
E at java.lang.Thread.run(Thread.java:764)
224109.0.0
"config": {
"webkitGTK": "2.18.2",
"androidICU": "8.0.0_r34",
"i18n": true
}
Calling Number.toLocaleString
throws an error, Failed to format a number.
I'm running the jsc-android-intl
variant of the prebuilt packages. Config file in my React Native are according to the documentation in this repo, except for android/app/build.gradle
, where I had to use the following config to use the intl
variant of the provided builds:
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'android-jsc') {
details.useTarget group: details.requested.group, name: 'android-jsc-intl', version: 'r224109'
}
}
}
}
I found the config information above here. Any help greatly appreciated.
Originally I posted about this in #29 but I felt it was more appropriate to have a separate issue.
Following the build instructions on macOS Sierrra 10.12.6 (without Docker) when I run all.sh
I get the following error:
DYLD_LIBRARY_PATH=jsc-android-buildscripts/target/icu/host/stubdata:jsc-android-buildscripts/target/icu/host/tools/ctestfw:jsc-android-buildscripts/target/icu/host/lib:$DYLD_LIBRARY_PATH jsc-android-buildscripts/target/icu/host/bin/pkgdata -O ../data/icupkg.inc -q -c -s jsc-android-buildscripts/target/icu/arm-linux-androideabi-no-intl/data/out/build/icudt56l -d ../lib -e icudt56 -T ./out/tmp -p icudt56l -m dll -L icudata_jsc ./out/tmp/icudata.lst
Error allocating memory for pkgDataFlags.
Warning: Providing a revision number with the -r option is recommended when packaging data in the current mode.
make[1]: *** [packagedata] Segmentation fault: 11
make[1]: Leaving directory `jsc-android-buildscripts/target/icu/arm-linux-androideabi-no-intl/data'
make: *** [all-recursive] Error 2
Passing -DCMAKE_SYSTEM_PROCESSOR=arm64
is not the expected arch, causing the build to fail with newer JSC. Looking at the CMake entry file we can see that the expected architecture for x64 builds is actually aarch64
. This fixes the compile error no magic numbers found for offline asm
.
Maybe I have configured something wrong?
Is this supported on Windows? When trying to npm i --save jsc-android
, I get an error concerning fsevents, which is only available on macOS.
Its not an issue but more an interrogation.
You provide a new JSC, greate job.
But why you don't change the metro-react-native-preset?
metro-react-native-preset embed many plugins to transpile code to ecmascript, so the es6/es7/es8 language implementation by the new JSC are not use.
In my opinion, would be better to create a new preset containing only the babel plugins not implemented in the new JSC.
What your opinion?
Regards
How do you upgrade JSC android on windows?
I would love if the information that Readme says it should be there is.
A quick question as I couldn't find it in the docs but does this support Proxies? Are you running code using them without any issues?
I am trying to run this on genymotion with android 8 and 7 but I get this error:
08-23 11:00:41.103: E/unknown:ReactNative(7294): java.lang.RuntimeException: Error in callNativeModules():45,2,11,0,211,100,1535022041102,false,176
(that's the java error, RN shows the red screen)
On a real device (android 7) it seem to work.
What other info should I provide?
Thank you 🤗
We need an easy way to know in runtime which version is inside the apk. One possibility is to print it out to logcat on load. Another is to add a metadata file alongside the .so file.
As in facebook/react-native#11171, I’m unable to run the sampling profiler. Perhaps this is strictly a React Native issue, but this seems like a reasonable place to at least ask: is it possible to get the profiler working with a custom JSC? I attempted to do so by modifying the patch to not disable some build options (ENABLE_SAMPLING_PROFILER
, ENABLE_DFG_JIT
, ENABLE_FTL_JIT
), but the RN error “No JSC registered” occurs nonetheless.
I get this an error when trying to make a project:
Cause: method ID not in [0, 0xffff]: 65536
if I try to run a project, I get this mistake:
Multiple dex files define Lcom/facebook/share/model/ShareOpenGraphObject$Builder;
log of error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
at java.util.ArrayList.forEach(ArrayList.java:1251)
at com.android.builder.dexing.DxDexArchiveMerger.mergeMonoDex(DxDexArchiveMerger.java:177)
at com.android.builder.dexing.DxDexArchiveMerger.mergeDexArchives(DxDexArchiveMerger.java:118)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:97)
at com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:121)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at sun.reflect.GeneratedMethodAccessor593.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
at com.android.builder.dexing.DxDexArchiveMerger.lambda$mergeMonoDex$0(DxDexArchiveMerger.java:171)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
... 4 more
Caused by: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:72)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
... 4 more
Caused by: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$8.updateIndex(DexMerger.java:565)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:276)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:574)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:166)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
... 6 more
Version of the jsc-android: 236355.1.1
Here is project build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Local Maven repo containing AARs with JSC library built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
ext {
buildToolsVersion = "26.0.2"
minSdkVersion = 16
compileSdkVersion = 26
targetSdkVersion = 26
supportLibVersion = "26.0.2"
}
Here is app build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId 'com.df.feelix'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
buildToolsVersion '26.0.2'
productFlavors {
}
packagingOptions {
pickFirst '**/libc++_shared.so'
}
}
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'android-jsc') {
details.useTarget group: details.requested.group, name: 'android-jsc-intl', version: 'r236355'
}
}
}
}
dependencies {
implementation project(':react-native-code-push')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'com.facebook.react:react-native:+'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-login:[4,5)'
// From node_modules
implementation project(':react-native-locale')
implementation project(':react-native-facebook-login')
implementation project(':react-native-image-picker')
implementation project(':react-native-document-picker')
implementation project(':react-native-image-resizer')
implementation project(':react-native-pdf')
implementation project(':rn-fetch-blob')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-exception-handler')
implementation project(':instabug-reactnative')
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
jsc-android-buildscripts/scripts/compile/toolchain.sh: line 9: /Users/name/Library/Android/sdk:/ndk-bundle/build/tools/make_standalone_toolchain.py: No such file or directory
Installed all required packages mentioned in README
I can see in compilation flags that exception support and RTTI are disabled. Could this be changed as recent NDK now supports them. if not, what is the rationale behind it?
https://github.com/react-community/jsc-android-buildscripts/blob/5fcba1abbad984f65e57c15439a6b27f488a430f/scripts/compile/common.sh#L135
https://github.com/react-community/jsc-android-buildscripts/blob/5fcba1abbad984f65e57c15439a6b27f488a430f/scripts/compile/jsc.sh#L17
As much as possible anyway
Trying to use this with a fresh react-native build gave me this error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [org.webkit:android-jsc:r224109] /Users/ashconnell/code/rnProxyTest/android/app/build/intermediates/exploded-aar/org.webkit/android-jsc/r224109/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.webkit.androidjsc" to force usage
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I opened up android/app/build.gradle
and changed minSdkVersion
from 16
to 21
and it worked.
Should this go in the readme?
Some suggestions by matthargett:
Just question, how to use this library outside react native project, say native android project?
I am just starting with Android NDK, and i am trying to run JavaScriptCore Engine inside Android dalvik VM.
Can i use this build with Android NDK, without using react native? If Yes, can you help with the instructions
Thank you
I have followed the steps in the readme to build my React Native Android app with the latest JSC, but am not noticing any performance improvements.
How can I determine if my app is really using that JSC build and not the default, old one bundled with RN?
Hey there!
I'm using this for a non-react project and I dont get why in the dist folder there is the libc++_shared.so library. I believe this is from ndk and i don't need to put this file in my project.
I am doing ./all.sh
and It seems like it falls into a infinite loop...
[843/1128] /bitrise/src/target/toolchains/aarch64-linux-android/bin/aarch64-linux-android-clang --sysroot=/opt/android-ndk/platforms/android-21/arch-arm64
...
I see this [somenumber/1128] several time, not sure if these are all the same thou,
Is this normal??
Building the ICU dependency fails with the current master (see log extract):
g++ ... /home/adrcab01/test/jsc-android-buildscripts-2/build/target/icu/source/i18n/affixpatternparser.cpp
g++ ... /home/adrcab01/test/jsc-android-buildscripts-2/build/target/icu/source/i18n/decimfmtimpl.cpp
g++ ... /home/adrcab01/test/jsc-android-buildscripts-2/build/target/icu/source/i18n/smallintformatter.cpp
g++ ... /home/adrcab01/test/jsc-android-buildscripts-2/build/target/icu/source/i18n/visibledigits.cpp
g++ ... /home/adrcab01/test/jsc-android-buildscripts-2/build/target/icu/source/i18n/dayperiodrules.cpp
g++ --std=c++11 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -shared -Wl,-Bsymbolic -Wl,-soname -Wl,libicui18n_jsc.so -o ../lib/libicui18n_jsc.so.58.1 ucln_in.o fmtable.o format.o msgfmt.o umsg.o numfmt.o unum.o decimfmt.o decimalformatpattern.o dcfmtsym.o digitlst.o fmtable_cnv.o choicfmt.o datefmt.o smpdtfmt.o reldtfmt.o dtfmtsym.o udat.o dtptngen.o udatpg.o nfrs.o nfrule.o nfsubs.o rbnf.o numsys.o unumsys.o ucsdet.o ucal.o calendar.o gregocal.o timezone.o simpletz.o olsontz.o astro.o taiwncal.o buddhcal.o persncal.o islamcal.o japancal.o gregoimp.o hebrwcal.o indiancal.o chnsecal.o cecal.o coptccal.o dangical.o ethpccal.o coleitr.o coll.o sortkey.o bocsu.o ucoleitr.o ucol.o ucol_res.o ucol_sit.o collation.o collationsettings.o collationdata.o collationtailoring.o collationdatareader.o collationdatawriter.o collationfcd.o collationiterator.o utf16collationiterator.o utf8collationiterator.o uitercollationiterator.o collationsets.o collationcompare.o collationfastlatin.o collationkeys.o rulebasedcollator.o collationroot.o collationrootelements.o collationdatabuilder.o collationweights.o collationruleparser.o collationbuilder.o collationfastlatinbuilder.o strmatch.o usearch.o search.o stsearch.o translit.o utrans.o esctrn.o unesctrn.o funcrepl.o strrepl.o tridpars.o cpdtrans.o rbt.o rbt_data.o rbt_pars.o rbt_rule.o rbt_set.o nultrans.o remtrans.o casetrn.o titletrn.o tolowtrn.o toupptrn.o anytrans.o name2uni.o uni2name.o nortrans.o quant.o transreg.o brktrans.o regexcmp.o rematch.o repattrn.o regexst.o regextxt.o regeximp.o uregex.o uregexc.o ulocdata.o measfmt.o currfmt.o curramt.o currunit.o measure.o utmscale.o csdetect.o csmatch.o csr2022.o csrecog.o csrmbcs.o csrsbcs.o csrucode.o csrutf8.o inputext.o wintzimpl.o windtfmt.o winnmfmt.o basictz.o dtrule.o rbtz.o tzrule.o tztrans.o vtzone.o zonemeta.o standardplural.o upluralrules.o plurrule.o plurfmt.o selfmt.o dtitvfmt.o dtitvinf.o udateintervalformat.o tmunit.o tmutamt.o tmutfmt.o currpinf.o uspoof.o uspoof_impl.o uspoof_build.o uspoof_conf.o decfmtst.o smpdtfst.o ztrans.o zrule.o vzone.o fphdlimp.o fpositer.o ufieldpositer.o decNumber.o decContext.o alphaindex.o tznames.o tznames_impl.o tzgnames.o tzfmt.o compactdecimalformat.o gender.o region.o scriptset.o uregion.o reldatefmt.o quantityformatter.o measunit.o sharedbreakiterator.o scientificnumberformatter.o digitgrouping.o digitinterval.o digitformatter.o digitaffix.o valueformatter.o digitaffixesandpadding.o pluralaffix.o precision.o affixpatternparser.o smallintformatter.o decimfmtimpl.o visibledigits.o dayperiodrules.o -L../lib -licuuc_jsc -L../stubdata -licudata_jsc -lpthread -ldl -lm
rm -f ../lib/libicui18n_jsc.so.58 && ln -s libicui18n_jsc.so.58.1 ../lib/libicui18n_jsc.so.58
rm -f ../lib/libicui18n_jsc.so && ln -s libicui18n_jsc.so.58.1 ../lib/libicui18n_jsc.so
make[1]: Leaving directory '/home/adrcab01/test/jsc-android-buildscripts-2/build/target/icu/host/i18n'
make[0]: Making `all' in `layoutex'
/bin/bash: line 10: cd: layoutex: No such file or directory
Makefile:143: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
Disabling layout/layoutex in the configuration phase for ICU does the trick:
- $TARGETDIR/icu/source/runConfigureICU Linux --prefix=$PWD/prebuilts CFLAGS="-Os" CXXFLAGS="--std=c++11" --disable-tests --disable-samples
+ $TARGETDIR/icu/source/runConfigureICU Linux --prefix=$PWD/prebuilts CFLAGS="-Os" CXXFLAGS="--std=c++11" --disable-tests --disable-samples --disable-layout --disable-layoutex
Ubuntu 18.04
Current master (3096553
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.