Quickstart App Crashes on Startup on M2 MacBook and XCode 14.2
mhoelter opened this issue · comments
Describe the issue
I've recently upgraded to a new M2 MacBook using XCode 14.2. When I run the example project, following the steps outlined in the README (including updating the Legacy build system settings), the app will compile without issue.
However, when it loads and runs the app in the iOS Simulator, the app crashes on start. I've tried on both the iPhone 13 (iOS 15.2) and iPhone 14 (16.2).
XCode Error Report:
dyld[80343]: Library not loaded: @rpath/SquareCore.framework/SquareCore
Referenced from: <0BCBCD56-37CF-34BC-890E-E8DB50096DB0> /Users/matthew/Desktop/react-native-square-reader-sdk/reader-sdk-react-native-quickstart/ios/build/Debug-iphonesimulator/SquareReaderSDK.framework/SquareReaderSDK
Reason: tried: '/Users/matthew/Desktop/react-native-square-reader-sdk/reader-sdk-react-native-quickstart/ios/build/Debug-iphonesimulator/SquareCore.framework/SquareCore' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2), '/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2, no dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2), '/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2, no dyld cache), '/Users/matthew/Library/Developer/CoreSimulator/Devices/26A52692-E292-4098-B6EA-B2FDE7C4050E/data/Containers/Bundle/Application/E43B3353-3F0D-40AB-A412-FD904BE2C0BE/RNReaderSDKSample.app/Frameworks/SquareCore.framework/SquareCore' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2), '/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2, no dyld cache), '/Users/matthew/Library/Developer/CoreSimulator/Devices/26A52692-E292-4098-B6EA-B2FDE7C4050E/data/Containers/Bundle/Application/E43B3353-3F0D-40AB-A412-FD904BE2C0BE/RNReaderSDKSample.app/Frameworks/SquareCore.framework/SquareCore' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SquareCore.framework/SquareCore' (errno=2)
macOS Error Report:
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Incident Identifier: A9E2F318-CB72-474C-B3ED-A947364DB6F7
CrashReporter Key: 0EB53889-917E-441B-8340-2AE5B2D4C3C0
Hardware Model: Mac14,6
Process: RNReaderSDKSample [75262]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/26A52692-E292-4098-B6EA-B2FDE7C4050E/data/Containers/Bundle/Application/D9D912ED-548E-4262-B5BC-F7A1AA4E4595/RNReaderSDKSample.app/RNReaderSDKSample
Identifier: org.reactjs.native.example.RNReaderSDKSample
Version: 1.0 (1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd_sim [74223]
Coalition: com.apple.CoreSimulator.SimDevice.26A52692-E292-4098-B6EA-B2FDE7C4050E [20658]
Responsible Process: SimulatorTrampoline [8379]
Date/Time: 2023-01-30 16:29:36.9085 -0600
Launch Time: 2023-01-30 16:29:36.8907 -0600
OS Version: macOS 13.2 (22D49)
Release Type: User
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/SquareCore.framework/SquareCore
Referenced from: <87FB9B1C-0FC4-3AE3-A735-08A12F7E24B0> /Users/USER/Library/Developer/CoreSimulator/Devices/26A52692-E292-4098-B6EA-B2FDE7C4050E/data/Containers/Bundle/Application/D9D912ED-548E-4262-B5BC-F7A1AA4E4595/RNReaderSDKSample.app/Frameworks/SquareReaderSDK.framework/SquareReaderSDK
Reason: tried: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2), '/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2), '/usr/lib/swift/SquareCore.framework/SquareCore' (errno=2, not in dyld cache), '/Users/matthew/Library/Developer/CoreSi
(terminated at launch; ignore backtrace)
Triggered by Thread: 0
Thread 0 Crashed:
0 dyld 0x104269190 __abort_with_payload + 8
1 dyld 0x104273a00 abort_with_payload_wrapper_internal + 104
2 dyld 0x104273a34 abort_with_payload + 16
3 dyld_sim 0x104103cfc abort_with_payload + 40
4 dyld_sim 0x1040c3f38 dyld4::halt(char const*) + 324
5 dyld_sim 0x1040c1c60 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3148
6 dyld_sim 0x1040c1e78 _dyld_sim_prepare + 424
7 dyld 0x1041ff8bc dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1264
8 dyld 0x1041fe13c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 272
9 dyld 0x1041fddc4 start + 2404
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000006 x1: 0x0000000000000001 x2: 0x000000016d3f3e20 x3: 0x000000000000012a
x4: 0x000000016d3f3a20 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x0000000000000020 x9: 0x0000000000000011 x10: 0x0000000000000000 x11: 0x207972617262694c
x12: 0x000000000000002f x13: 0x0000000000000037 x14: 0x0000000000000002 x15: 0xffffffffffffffff
x16: 0x0000000000000209 x17: 0x00000001041fbe7c x18: 0x0000000000000000 x19: 0x0000000000000000
x20: 0x000000016d3f3a20 x21: 0x000000000000012a x22: 0x000000016d3f3e20 x23: 0x0000000000000001
x24: 0x0000000000000006 x25: 0x000000016d3f4f10 x26: 0x000000016d3f4e28 x27: 0x0000000104114090
x28: 0x0000000000000000 fp: 0x000000016d3f39e0 lr: 0x0000000104273a00
sp: 0x000000016d3f39a0 pc: 0x0000000104269190 cpsr: 0x00001000
far: 0x0000000103fb4028 esr: 0x56000080 Address size fault
Binary Images:
0x1041f8000 - 0x104283fff dyld (*) <fe8a9d9e-f65d-34ca-942c-175b99c0601b> /usr/lib/dyld
0x1040c0000 - 0x10410ffff dyld_sim (*) <d763ecdd-458a-3dc0-92d4-bf4f7a54bfbb> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed
EOF
-----------
Full Report
-----------
{"app_name":"RNReaderSDKSample","timestamp":"2023-01-30 16:29:37.00 -0600","app_version":"1.0","slice_uuid":"f0149711-c37c-3f3f-bddd-39805d07d13f","build_version":"1","platform":7,"bundleID":"org.reactjs.native.example.RNReaderSDKSample","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 13.2 (22D49)","roots_installed":0,"name":"RNReaderSDKSample","incident_id":"A9E2F318-CB72-474C-B3ED-A947364DB6F7"}
{
"uptime" : 61000,
"procRole" : "Foreground",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "Mac14,6",
"coalitionID" : 20658,
"osVersion" : {
"train" : "macOS 13.2",
"build" : "22D49",
"releaseType" : "User"
},
"captureTime" : "2023-01-30 16:29:36.9085 -0600",
"incident" : "A9E2F318-CB72-474C-B3ED-A947364DB6F7",
"pid" : 75262,
"translated" : false,
"cpuType" : "ARM-64",
"roots_installed" : 0,
"bug_type" : "309",
"procLaunch" : "2023-01-30 16:29:36.8907 -0600",
"procStartAbsTime" : 1471863033942,
"procExitAbsTime" : 1471863440395,
"procName" : "RNReaderSDKSample",
"procPath" : "\/Users\/USER\/Library\/Developer\/CoreSimulator\/Devices\/26A52692-E292-4098-B6EA-B2FDE7C4050E\/data\/Containers\/Bundle\/Application\/D9D912ED-548E-4262-B5BC-F7A1AA4E4595\/RNReaderSDKSample.app\/RNReaderSDKSample",
"bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1","CFBundleIdentifier":"org.reactjs.native.example.RNReaderSDKSample"},
"storeInfo" : {"deviceIdentifierForVendor":"5B903392-BDA3-5C59-AF4E-040F9C226685","thirdParty":true},
"parentProc" : "launchd_sim",
"parentPid" : 74223,
"coalitionName" : "com.apple.CoreSimulator.SimDevice.26A52692-E292-4098-B6EA-B2FDE7C4050E",
"crashReporterKey" : "0EB53889-917E-441B-8340-2AE5B2D4C3C0",
"responsiblePid" : 8379,
"responsibleProc" : "SimulatorTrampoline",
"wakeTime" : 9899,
"sleepWakeUUID" : "0D265FF7-49DA-4378-A80F-FD514923E6B3",
"sip" : "disabled",
"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
"termination" : {"code":1,"flags":518,"namespace":"DYLD","indicator":"Library missing","details":["(terminated at launch; ignore backtrace)"],"reasons":["Library not loaded: @rpath\/SquareCore.framework\/SquareCore","Referenced from: <87FB9B1C-0FC4-3AE3-A735-08A12F7E24B0> \/Users\/USER\/Library\/Developer\/CoreSimulator\/Devices\/26A52692-E292-4098-B6EA-B2FDE7C4050E\/data\/Containers\/Bundle\/Application\/D9D912ED-548E-4262-B5BC-F7A1AA4E4595\/RNReaderSDKSample.app\/Frameworks\/SquareReaderSDK.framework\/SquareReaderSDK","Reason: tried: '\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/swift\/SquareCore.framework\/SquareCore' (errno=2), '\/usr\/lib\/swift\/SquareCore.framework\/SquareCore' (errno=2, not in dyld cache), '\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/swift\/SquareCore.framework\/SquareCore' (errno=2), '\/usr\/lib\/swift\/SquareCore.framework\/SquareCore' (errno=2, not in dyld cache), '\/Users\/matthew\/Library\/Developer\/CoreSi"]},
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":2,"thread_set_state":102,"task_for_pid":160},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":1315419,"threadState":{"x":[{"value":6},{"value":1},{"value":6127828512},{"value":298},{"value":6127827488},{"value":0},{"value":0},{"value":0},{"value":32},{"value":17},{"value":0},{"value":2340027244252129612},{"value":47},{"value":55},{"value":2},{"value":18446744073709551615},{"value":521},{"value":4364156540,"symbolLocation":56,"symbol":"fcntl"},{"value":0},{"value":0},{"value":6127827488},{"value":298},{"value":6127828512},{"value":1},{"value":6},{"value":6127832848},{"value":6127832616},{"value":4363206800,"symbolLocation":0,"symbol":"_NSConcreteStackBlock"},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4364646912},"cpsr":{"value":4096},"fp":{"value":6127827424},"sp":{"value":6127827360},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":4364603792,"matchesCrashFrame":1},"far":{"value":4361764904}},"frames":[{"imageOffset":463248,"symbol":"__abort_with_payload","symbolLocation":8,"imageIndex":0},{"imageOffset":506368,"symbol":"abort_with_payload_wrapper_internal","symbolLocation":104,"imageIndex":0},{"imageOffset":506420,"symbol":"abort_with_payload","symbolLocation":16,"imageIndex":0},{"imageOffset":277756,"symbol":"abort_with_payload","symbolLocation":40,"imageIndex":1},{"imageOffset":16184,"symbol":"dyld4::halt(char const*)","symbolLocation":324,"imageIndex":1},{"imageOffset":7264,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":3148,"imageIndex":1},{"imageOffset":7800,"symbol":"_dyld_sim_prepare","symbolLocation":424,"imageIndex":1},{"imageOffset":30908,"symbol":"dyld4::prepareSim(dyld4::RuntimeState&, char const*)","symbolLocation":1264,"imageIndex":0},{"imageOffset":24892,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":272,"imageIndex":0},{"imageOffset":24004,"symbol":"start","symbolLocation":2404,"imageIndex":0}]}],
"usedImages" : [
{
"source" : "P",
"arch" : "arm64e",
"base" : 4364140544,
"size" : 573440,
"uuid" : "fe8a9d9e-f65d-34ca-942c-175b99c0601b",
"path" : "\/usr\/lib\/dyld",
"name" : "dyld"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4362862592,
"size" : 327680,
"uuid" : "d763ecdd-458a-3dc0-92d4-bf4f7a54bfbb",
"path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/dyld_sim",
"name" : "dyld_sim"
}
],
"vmSummary" : "ReadOnly portion of Libraries: Total=684.7M resident=0K(0%) swapped_out_or_unallocated=684.7M(100%)\nWritable regions: Total=10.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=10.4M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nSTACK GUARD 56.0M 1 \nStack 8176K 1 \nVM_ALLOCATE 16K 1 \n__DATA 16.8M 210 \n__DATA_CONST 26.0M 215 \n__DATA_DIRTY 66K 11 \n__FONT_DATA 4K 1 \n__LINKEDIT 384.9M 19 \n__OBJC_RO 28.4M 1 \n__OBJC_RW 882K 1 \n__TEXT 299.7M 223 \ndyld private memory 768K 3 \n=========== ======= ======= \nTOTAL 821.6M 687 \n",
"legacyInfo" : {
"threadTriggered" : {
}
},
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "6347054113acce15305b7b82",
"factorPackIds" : {
"SIRI_MEMORY_SYNC_CONFIG" : "634705e78e8be655c1316a6e"
},
"deploymentId" : 240000005
},
{
"rolloutId" : "63582c5f8a53461413999550",
"factorPackIds" : {
},
"deploymentId" : 240000002
}
],
"experiments" : [
]
},
"reportNotes" : [
"dyld_process_snapshot_get_shared_cache failed"
]
}
Model: Mac14,6, BootROM 8419.80.7, proc 12:8:4 processors, 64 GB, SMC
Graphics: Apple M2 Max, Apple M2 Max, Built-In
I've ensured I've run pod install
from the ios/
directory. I also found this StackOverflow answer and tried for SquareCore, but didn't help.
To Reproduce
- Clone this project and follow the steps outlined in the README, including the Legacy build system step.
- Run
yarn ios
and wait to successfully compile - Simulator starts and app crashes
Expected behavior
The app starts without crashing in the iOS Simulator
Environment (please complete the following information):
System:
OS: macOS 13.2
CPU: (12) arm64 Apple M2 Max
Memory: 2.46 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node
Yarn: 3.3.1 - ~/.nvm/versions/node/v14.17.3/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.3/bin/npm
Watchman: 2023.01.23.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/matthew/.rvm/gems/ruby-2.7.4/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.2 => 0.67.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found