rive-app / rive-react-native

MIT License
537 stars 39 forks source link

Not working with use_frameworks! :linkage => :static (Expo 51 & RN 0.74.3) #261

Open AChevallier opened 2 months ago

AChevallier commented 2 months ago

I am upgrading from expo 50 to expo 51 with "rive-react-native": "7.3.0" My builds on android & ios are working. Everything is working well on android.

after a successful eas build -p ios --profile simulator --local --clear-cache, I start the app and it crashes. I can see 0x10e7cc000 - 0x10eceffff rive.app.ios.runtime.RiveRuntime (5.14.0) in the crash.

I tried to remove rive-react-native from my app & it worked

Has anyone managed to get it to work on Expo 51?

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 1
CrashReporter Key:   1
Hardware Model:      MacBookPro18,3
Process:             XXXXX [7197]
Path:                XXX
Identifier:          XXX
Version:             1.0.0 (1)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [6362]
Coalition:           com.apple.CoreSimulator.SimDevice.CF22F361-AC78-4974-98D5-436C32776898 [51711]
Responsible Process: SimulatorTrampoline [5943]

Date/Time:           2024-08-05 12:34:18.8075 +0100
Launch Time:         2024-08-05 12:33:04.2247 +0100
OS Version:          macOS 15.0 (24A5298h)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000104100
Exception Codes: 0x0000000000000001, 0x0000000000104100
VM Region Info: 0x104100 is not in any region.  Bytes before following region: 4327571200
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      10201c000-105b6c000    [ 59.3M] r-x/r-x SM=COW  /Users/USER/Library/Developer/CoreSimulator/Devices/CF22F361-AC78-4974-98D5-436C32776898/data/Containers/Bundle/Application/2E347A4B-7D9F-4534-9B53-D8E4ADCAA538/XXXXX.app/XXXXX
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [7197]

Triggered by Thread:  3

Thread 0::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                 0x10d3a9290 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x10d3ba6c4 mach_msg2_internal + 76
2   libsystem_kernel.dylib                 0x10d3b13f4 mach_msg_overwrite + 536
3   libsystem_kernel.dylib                 0x10d3a95cc mach_msg + 20
4   CoreFoundation                         0x18040e684 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                         0x180408d64 __CFRunLoopRun + 1148
6   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
7   GraphicsServices                       0x18ef2aae4 GSEventRunModal + 160
8   UIKitCore                              0x1853d0a28 -[UIApplication _run] + 868
9   UIKitCore                              0x1853d46b0 UIApplicationMain + 124
10  XXXXX                                  0x102021e0c main + 96
11  dyld_sim                               0x10d1e1544 start_sim + 20
12  dyld                                   0x10d432274 start + 2840

Thread 1:
0   libsystem_pthread.dylib                0x10d14692c start_wqthread + 0

Thread 2:: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib                 0x10d3a9290 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x10d3ba6c4 mach_msg2_internal + 76
2   libsystem_kernel.dylib                 0x10d3b13f4 mach_msg_overwrite + 536
3   libsystem_kernel.dylib                 0x10d3a95cc mach_msg + 20
4   CoreFoundation                         0x18040e684 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                         0x180408d64 __CFRunLoopRun + 1148
6   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
7   Foundation                             0x180dd340c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8   Foundation                             0x180dd3630 -[NSRunLoop(NSRunLoop) runUntilDate:] + 60
9   UIKitCore                              0x1854773f8 -[UIEventFetcher threadMain] + 404
10  Foundation                             0x180df9c64 __NSThread__start__ + 720
11  libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
12  libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 3 Crashed::  Dispatch queue: com.facebook.react.ShadowQueue
0   ???                                       0x104100 ???
1   XXXXX                                  0x10366b728 -[RCTShadowView layoutWithMinimumSize:maximumSize:layoutDirection:layoutContext:] + 176
2   XXXXX                                  0x1036598e0 -[RCTRootShadowView layoutWithAffectedShadowViews:] + 248
3   XXXXX                                  0x10367f3cc -[RCTUIManager uiBlockWithLayoutUpdateForRootView:] + 344
4   XXXXX                                  0x103684de4 -[RCTUIManager _layoutAndMount] + 336
5   XXXXX                                  0x103684c88 -[RCTUIManager batchDidComplete] + 32
6   XXXXX                                  0x1035d5b64 __32-[RCTCxxBridge batchDidComplete]_block_invoke + 56
7   libdispatch.dylib                      0x180170104 _dispatch_call_block_and_release + 24
8   libdispatch.dylib                      0x180171978 _dispatch_client_callout + 16
9   libdispatch.dylib                      0x180179b10 _dispatch_lane_serial_drain + 960
10  libdispatch.dylib                      0x18017a688 _dispatch_lane_invoke + 388
11  libdispatch.dylib                      0x180185a84 _dispatch_root_queue_drain_deferred_wlh + 276
12  libdispatch.dylib                      0x1801850d0 _dispatch_workloop_worker_thread + 448
13  libsystem_pthread.dylib                0x10d147b74 _pthread_wqthread + 284
14  libsystem_pthread.dylib                0x10d146934 start_wqthread + 8

Thread 4:: com.apple.CFNetwork.CustomProtocols
0   libsystem_kernel.dylib                 0x10d3a9290 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x10d3ba6c4 mach_msg2_internal + 76
2   libsystem_kernel.dylib                 0x10d3b13f4 mach_msg_overwrite + 536
3   libsystem_kernel.dylib                 0x10d3a95cc mach_msg + 20
4   CoreFoundation                         0x18040e684 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                         0x180408d64 __CFRunLoopRun + 1148
6   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
7   CFNetwork                              0x184526cd8 0x18430f000 + 2194648
8   Foundation                             0x180df9c64 __NSThread__start__ + 720
9   libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
10  libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 5:: com.facebook.SocketRocket.NetworkThread
0   libsystem_kernel.dylib                 0x10d3a9290 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x10d3ba6c4 mach_msg2_internal + 76
2   libsystem_kernel.dylib                 0x10d3b13f4 mach_msg_overwrite + 536
3   libsystem_kernel.dylib                 0x10d3a95cc mach_msg + 20
4   CoreFoundation                         0x18040e684 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                         0x180408d64 __CFRunLoopRun + 1148
6   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
7   Foundation                             0x180dd340c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8   XXXXX                                  0x103fa7978 -[SRRunLoopThread main] + 260
9   Foundation                             0x180df9c64 __NSThread__start__ + 720
10  libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
11  libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 6:: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib                 0x10d3a9290 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x10d3ba6c4 mach_msg2_internal + 76
2   libsystem_kernel.dylib                 0x10d3b13f4 mach_msg_overwrite + 536
3   libsystem_kernel.dylib                 0x10d3a95cc mach_msg + 20
4   CoreFoundation                         0x18040e684 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                         0x180408d64 __CFRunLoopRun + 1148
6   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
7   CFNetwork                              0x184526cd8 0x18430f000 + 2194648
8   Foundation                             0x180df9c64 __NSThread__start__ + 720
9   libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
10  libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 7:: com.facebook.react.JavaScript
0   libsystem_malloc.dylib                 0x1801d79c4 _free + 48
1   libobjc.A.dylib                        0x180086ddc AutoreleasePoolPage::releaseUntil(objc_object**) + 220
2   libobjc.A.dylib                        0x180086c98 objc_autoreleasePoolPop + 256
3   XXXXX                                  0x10361da9c invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 56
4   CoreFoundation                         0x18040ec10 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
5   CoreFoundation                         0x18040e358 __CFRunLoopDoBlocks + 352
6   CoreFoundation                         0x180409224 __CFRunLoopRun + 2364
7   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
8   XXXXX                                  0x1035c8c48 +[RCTCxxBridge runRunLoop] + 736
9   Foundation                             0x180df9c64 __NSThread__start__ + 720
10  libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
11  libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 8:: com.apple.CFSocket.private
0   libsystem_kernel.dylib                 0x10d3b3700 __select + 8
1   CoreFoundation                         0x18041d06c __CFSocketManager + 612
2   libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
3   libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 9:: hades
0   libsystem_kernel.dylib                 0x10d3ac72c __psynch_cvwait + 8
1   libsystem_pthread.dylib                0x10d14bc98 _pthread_cond_wait + 1192
2   libc++.1.dylib                         0x1802ea6d8 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3   hermes                                 0x10f002448 hermes::vm::HadesGC::Executor::worker() + 112
4   hermes                                 0x10f0023ac void* std::__1::__thread_proxy[abi:v160006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, hermes::vm::HadesGC::Executor::Executor()::'lambda'()>>(void*) + 44
5   libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
6   libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 10:
0   libsystem_pthread.dylib                0x10d14692c start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib                0x10d14692c start_wqthread + 0

Thread 12:: com.apple.CFStream.LegacyThread
0   libsystem_kernel.dylib                 0x10d3a9290 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x10d3ba6c4 mach_msg2_internal + 76
2   libsystem_kernel.dylib                 0x10d3b13f4 mach_msg_overwrite + 536
3   libsystem_kernel.dylib                 0x10d3a95cc mach_msg + 20
4   CoreFoundation                         0x18040e684 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                         0x180408d64 __CFRunLoopRun + 1148
6   CoreFoundation                         0x1804084d4 CFRunLoopRunSpecific + 572
7   CoreFoundation                         0x18042bd80 _legacyStreamRunLoop_workThread + 260
8   libsystem_pthread.dylib                0x10d14b6f8 _pthread_start + 104
9   libsystem_pthread.dylib                0x10d146940 thread_start + 8

Thread 13:
0   libsystem_pthread.dylib                0x10d14692c start_wqthread + 0

Thread 14:
0   libsystem_pthread.dylib                0x10d14692c start_wqthread + 0

Thread 3 crashed with ARM Thread State (64-bit):
    x0: 0x000000010da1ab30   x1: 0x0000000000104100   x2: 0x000000007f8f0f0f   x3: 0x000000016e099fa0
    x4: 0x0000000000000004   x5: 0x0000000000000000   x6: 0x0000000000000072   x7: 0x0000000000000000
    x8: 0x0000000000000014   x9: 0x0000000000000004  x10: 0x00000001036182dc  x11: 0x0000000000000001
   x12: 0x0000000020000001  x13: 0x0000000100000000  x14: 0x0000000100000000  x15: 0x0000000300000000
   x16: 0x000000010ec4bf80  x17: 0x000000010366b678  x18: 0x0000000000000000  x19: 0x000000010da1ab30
   x20: 0x000000007fc00000  x21: 0x0000000000000114  x22: 0x0000000000000004  x23: 0x0000000000000000
   x24: 0x0000600002c285e8  x25: 0x0000000000000000  x26: 0x0000000000000000  x27: 0x0000600001846c00
   x28: 0x0000000000000000   fp: 0x000000016e099d30   lr: 0x000000010ec49d30
    sp: 0x000000016e099d20   pc: 0x0000000000104100 cpsr: 0x20001000
   far: 0x0000000000104100  esr: 0x82000006 (Instruction Abort) Translation fault

Binary Images:
       0x10d42c000 -        0x10d4affff dyld (*) <080914bd-cd81-3697-869a-d72be1cf17a1> /usr/lib/dyld
       0x10d418000 -        0x10d423fff libobjc-trampolines.dylib (*) <c6ef2cc0-8ca9-3a69-a525-91bec719ddfc> /Volumes/VOLUME/*/libobjc-trampolines.dylib
       0x10e7cc000 -        0x10eceffff rive.app.ios.runtime.RiveRuntime (5.14.0) <1083a49d-e909-32bd-8c2b-65dc470d605d> /Users/USER/Library/Developer/CoreSimulator/Devices/CF22F361-AC78-4974-98D5-436C32776898/data/Containers/Bundle/Application/2E347A4B-7D9F-4534-9B53-D8E4ADCAA538/XXXXX.app/Frameworks/RiveRuntime.framework/RiveRuntime
       0x10ee9c000 -        0x10f1a3fff dev.hermesengine.iphonesimulator (0.12.0) <da1e35b7-50d8-30f1-9c8f-759f09716be4> /Users/USER/Library/Developer/CoreSimulator/Devices/CF22F361-AC78-4974-98D5-436C32776898/data/Containers/Bundle/Application/2E347A4B-7D9F-4534-9B53-D8E4ADCAA538/XXXXX.app/Frameworks/hermes.framework/hermes
       0x10d1a0000 -        0x10d1a7fff libsystem_platform.dylib (*) <f10d409f-99af-3916-bf8f-af8bddcf5af6> /usr/lib/system/libsystem_platform.dylib
       0x10d3a8000 -        0x10d3e3fff libsystem_kernel.dylib (*) <51d14057-5ba5-314d-adac-1bd3afb55651> /usr/lib/system/libsystem_kernel.dylib
       0x10d144000 -        0x10d153fff libsystem_pthread.dylib (*) <a3ce76a2-e7e7-38a5-80e1-1c5ada47cc9a> /usr/lib/system/libsystem_pthread.dylib
       0x10201c000 -        0x105b6bfff com.XXXXX.app (1.9.4) <c4e998be-b328-3dfc-bfb4-7315415cd5d9> /Users/USER/Library/Developer/CoreSimulator/Devices/CF22F361-AC78-4974-98D5-436C32776898/data/Containers/Bundle/Application/2E347A4B-7D9F-4534-9B53-D8E4ADCAA538/XXXXX.app/XXXXX
       0x10d1e0000 -        0x10d22bfff dyld_sim (*) <f1d509a4-edf1-3668-b217-c6a2bd1fbef4> /Volumes/VOLUME/*/dyld_sim
       0x180381000 -        0x180734fff com.apple.CoreFoundation (6.9) <6c40f9e5-bffa-3413-9e1c-a4f724ad56ba> /Volumes/VOLUME/*/CoreFoundation.framework/CoreFoundation
       0x18ef27000 -        0x18ef2ffff com.apple.GraphicsServices (1.0) <b8bade4e-4da1-3e89-aadc-79d9356e07f1> /Volumes/VOLUME/*/GraphicsServices.framework/GraphicsServices
       0x1847df000 -        0x186186fff com.apple.UIKitCore (1.0) <8d3f22bc-9dec-3601-b822-2b88624be742> /Volumes/VOLUME/*/UIKitCore.framework/UIKitCore
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x1807b4000 -        0x181264fff com.apple.Foundation (6.9) <3a54db51-8b3a-308d-9f9e-51474c4a8520> /Volumes/VOLUME/*/Foundation.framework/Foundation
       0x18016e000 -        0x1801b3fff libdispatch.dylib (*) <b8c72eee-14e7-3c88-ae33-a9bf80378af5> /Volumes/VOLUME/*/libdispatch.dylib
       0x18430f000 -        0x1846a0fff com.apple.CFNetwork (1.0) <ad068dfd-5acf-3c3f-9449-adf0b044e328> /Volumes/VOLUME/*/CFNetwork.framework/CFNetwork
       0x1801b4000 -        0x1801edff7 libsystem_malloc.dylib (*) <a0a72526-44d3-3607-b245-be9351888fb9> /Volumes/VOLUME/*/libsystem_malloc.dylib
       0x18005c000 -        0x180098d93 libobjc.A.dylib (*) <78996745-4c54-3f78-b78d-e21931453c5a> /Volumes/VOLUME/*/libobjc.A.dylib
       0x1802da000 -        0x18035bfff libc++.1.dylib (*) <27a11d15-9506-3776-8d00-9f34bea3ecb1> /Volumes/VOLUME/*/libc++.1.dylib

EOF
mrcool-ru commented 2 months ago

I have the same issue if I use use_frameworks! :linkage => :static in Podfile Works fine without use_frameworks

Update: it works fine after downgrading to version 7.2.0

AChevallier commented 2 months ago

Thank you @mrcool-ru!

Indeed downgrading to version 7.2.0 seems to work. (sad because I had sightly more crash on android with the 7.2.0)

Unfortunately, I have to use use_frameworks! :linkage => :static because I am using react-native-firebase

Hopefully the 7.4.0 will fix that

DevYuns commented 2 months ago

I encountered a similar issue on ios. The build works fine in debug mode, but the IOS app crashes on startup with version 7.3.0. Android is ok.

JslinSir commented 2 months ago

+1

Thylacine-Software commented 1 month ago

Same happening to me. It seems that use-frameworks is not compatible with latest 7.3.0 version.

lancesnider commented 4 weeks ago

Thanks for reporting this! The problem is that our repo is a couple of RN versions behind. I've just started working on updating the it to support the latest couple of versions of RN. Step one is getting all of our packages upgraded to more recent versions while still using RN 0.72.x. This'll make it easier to do the next couple of upgrades. If anyone wants to give it a test on a 0.72.x project, that'd be super helpful: https://github.com/rive-app/rive-react-native/pull/267

alextoudic commented 1 week ago

I encountered the same issue and have been digging into it. IMO it's not related to Expo or React Native version as out-of-the-box, even latest versions are working fine with rive-react-native

The issue seems to be tied to use_frameworks! :linkage => :static, which a lot of people need for @react-native-firebase. The crash started happening after this commit in rive-ios.

It seems like with static linkage, symbols from Rive’s Yoga fork are being exported, which is causing a collision with React Native’s Yoga and leading to that bad access error.

I haven’t found a workaround, and I think this might need to be handled in rive-runtime to avoid these collisions

Any thoughts or ideas?