DeviceAgent-Runner quit unexpectedly - xamarin
I made a simple Xamarin.iOS app with a UI Test App project just to learn how to make automated UI test. I am using VSMac 2019 and following the documentation here:
https://learn.microsoft.com/en-us/appcenter/test-cloud/frameworks/uitest/
I installed the Xamarin.TestCloud.Agent nugget in my iOS project and added in my FinishedLaunching method:
#if ENABLE_TEST_CLOUD
Xamarin.Calabash.Start();
#endif
My AppInitializer class in my UI Test App project:
public class AppInitializer
{
public static IApp StartApp(Platform platform)
{
// TODO: If the iOS or Android app being tested is included in the solution
// then open the Unit Tests window, right click Test Apps, select Add App Project
// and select the app projects that should be tested.
//
// The iOS project should have the Xamarin.TestCloud.Agent NuGet package
// installed. To start the Test Cloud Agent the following code should be
// added to the FinishedLaunching method of the AppDelegate:
//
// #if ENABLE_TEST_CLOUD
// Xamarin.Calabash.Start();
// #endif
if (platform == Platform.Android)
{
return ConfigureApp
.Android
// TODO: Update this path to point to your Android app and uncomment the
// code if the app is not included in the solution.
//.ApkFile ("../../../Droid/bin/Debug/xamarinforms.apk")
.StartApp();
}
return ConfigureApp.iOS
.EnableLocalScreenshots()
.DeviceIdentifier("3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952")
.InstalledApp("com.drake.MyAppTest")
.StartApp();
}
}
It opens my simulator, installs the DeviceAgent app but then immediately crashes with this report:
------------------------------------- Translated Report (Full Report Below)
Incident Identifier: 42E3018F-F6AD-4A2D-BC85-F56CF5043C19
CrashReporter Key: CEC4770B-BEBD-CF8B-2D6A-E9045B038C60 Hardware
Model: MacBookPro16,1 Process: DeviceAgent-Runner
[81642] Path:
/Users/USER/Library/Developer/CoreSimulator/Devices/3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952/data/Containers/Bundle/Application/96AEC496-0C00-46F8-82DD-53187D30D145/DeviceAgent-Runner.app/DeviceAgent-Runner Identifier: com.apple.test.DeviceAgent-Runner Version:
2.2.3 (1605115037) Code Type: X86-64 (Native) Role: Non UI Parent Process: launchd_sim [81025] Coalition:
com.apple.CoreSimulator.SimDevice.3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952
[28614] Responsible Process: SimulatorTrampoline [1005]
Date/Time: 2023-01-10 16:15:23.1423 -0500 Launch Time:
2023-01-10 16:15:22.7223 -0500 OS Version: macOS 13.0.1
(22A400) Release Type: User Report Version: 104
Exception Type: EXC_CRASH (SIGABRT) Exception Codes:
0x0000000000000000, 0x0000000000000000 Triggered by Thread: 0
Last Exception Backtrace: 0 CoreFoundation
0x7ff80042889b __exceptionPreprocess + 226 1 libobjc.A.dylib
0x7ff80004dba3 objc_exception_throw + 48 2 Foundation 0x7ff800b87271 -[NSMutableDictionary(NSMutableDictionary) classForCoder] + 0 3 XCTest
0x10ac8c700 _XCTestMain + 761 4 DeviceAgent-Runner
0x10a69702d -[_XCTRunnerAppDelegate applicationWillResignActive:] + 0
5 DeviceAgent-Runner 0x10a696f2b
_XCTRunnerRunTests + 0 6 CoreFoundation 0x7ff800387dd9 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 7
CoreFoundation 0x7ff800387592 __CFRunLoopDoBlocks
406 8 CoreFoundation 0x7ff800381e38 __CFRunLoopRun + 948 9 CoreFoundation 0x7ff8003816a7 CFRunLoopRunSpecific + 560 10 GraphicsServices
0x7ff809cb128a GSEventRunModal + 139 11 UIKitCore 0x111f20ad3 -[UIApplication _run] + 994 12 UIKitCore 0x111f259ef UIApplicationMain + 123 13 DeviceAgent-Runner 0x10a6971f5 main + 183 14 dyld_sim 0x10a84f2bf start_sim + 10 15 dyld
0x1167cb310 start + 2432
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0
libsystem_kernel.dylib 0x7ff83611d30e __pthread_kill + 10
1 libsystem_pthread.dylib 0x7ff836175f7b pthread_kill +
263 2 libsystem_c.dylib 0x7ff800132fe0 abort + 130
3 libc++abi.dylib 0x7ff800258742 abort_message +
241 4 libc++abi.dylib 0x7ff80024995d
demangling_terminate_handler() + 266 5 libobjc.A.dylib
0x7ff800032082 _objc_terminate() + 96 6 libc++abi.dylib 0x7ff800257b65 std::__terminate(void (*)()) + 8 7 libc++abi.dylib 0x7ff80025a3a4 __cxa_rethrow + 99 8
libobjc.A.dylib 0x7ff80004dd0d
objc_exception_rethrow + 37 9 CoreFoundation
0x7ff800381769 CFRunLoopRunSpecific + 754 10 GraphicsServices
0x7ff809cb128a GSEventRunModal + 139 11 UIKitCore 0x111f20ad3 -[UIApplication _run] + 994 12 UIKitCore 0x111f259ef UIApplicationMain + 123 13 DeviceAgent-Runner 0x10a6971f5 main + 183 14 dyld_sim 0x10a84f2bf start_sim + 10 15 dyld
0x1167cb310 start + 2432
Thread 1: 0 libsystem_pthread.dylib 0x7ff836171c58
start_wqthread + 0
Thread 2:: Dispatch queue: AXCodeLoader 0 CoreFoundation
0x7ff80036007e -[__NSCFString retain] + 5 1 AccessibilityUtilities 0x7ff809d43c4f -[AXCodeLoader
_accessibilityCodeItemMatchingName:type:path:] + 703 2 AccessibilityUtilities 0x7ff809d43f9e -[AXCodeLoader
_associateAccessibilityCodeItemWithLoadedCodeItem:] + 334 3 AccessibilityUtilities 0x7ff809d41b41 __36-[AXCodeLoader
_addTrackedCodeItem:]_block_invoke + 273 4 libdispatch.dylib 0x7ff80013b7fb _dispatch_call_block_and_release + 12 5 libdispatch.dylib 0x7ff80013ca3a
_dispatch_client_callout + 8 6 libdispatch.dylib 0x7ff800144346 _dispatch_lane_serial_drain + 949 7 libdispatch.dylib
0x7ff800144fe3 _dispatch_lane_invoke + 400 8 libdispatch.dylib 0x7ff800151b46 _dispatch_workloop_worker_thread + 870 9 libsystem_pthread.dylib 0x7ff836172ce3 _pthread_wqthread +
326 10 libsystem_pthread.dylib 0x7ff836171c67
start_wqthread + 15
Thread 3: 0 libsystem_pthread.dylib 0x7ff836171c58
start_wqthread + 0
Thread 4:: com.apple.uikit.eventfetch-thread 0
libsystem_kernel.dylib 0x7ff8361166a2 mach_msg2_trap + 10
1 libsystem_kernel.dylib 0x7ff83612467d
mach_msg2_internal + 82 2 libsystem_kernel.dylib
0x7ff83611d71a mach_msg_overwrite + 723 3 libsystem_kernel.dylib
0x7ff836116989 mach_msg + 19 4 CoreFoundation 0x7ff80038788e __CFRunLoopServiceMachPort + 145 5 CoreFoundation
0x7ff800381fdf __CFRunLoopRun + 1371 6 CoreFoundation 0x7ff8003816a7 CFRunLoopRunSpecific + 560 7 Foundation 0x7ff800c568b4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213 8 Foundation 0x7ff800c56b2d
-[NSRunLoop(NSRunLoop) runUntilDate:] + 72 9 UIKitCore 0x111ff6286 -[UIEventFetcher threadMain] + 535 10 Foundation 0x7ff800c8011b NSThread__start + 1009 11 libsystem_pthread.dylib 0x7ff836176259 _pthread_start + 125
12 libsystem_pthread.dylib 0x7ff836171c7b thread_start +
15
Thread 5: 0 libsystem_pthread.dylib 0x7ff836171c58
start_wqthread + 0
Thread 6: 0 libsystem_pthread.dylib 0x7ff836171c58
start_wqthread + 0
Thread 0 crashed with X86 Thread State (64-bit): rax:
0x0000000000000000 rbx: 0x00000001168692c0 rcx: 0x00007ff7b5868748
rdx: 0x0000000000000000 rdi: 0x0000000000000103 rsi:
0x0000000000000006 rbp: 0x00007ff7b5868770 rsp: 0x00007ff7b5868748
r8: 0x00007ff7b5868610 r9: 0x00007ff7b5868870 r10:
0x0000000000000000 r11: 0x0000000000000246 r12: 0x0000000000000103
r13: 0x0000003000000008 r14: 0x0000000000000006 r15:
0x0000000000000016 rip: 0x00007ff83611d30e rfl: 0x0000000000000246
cr2: 0x00007ff800132f5e Logical CPU: 0 Error Code:
0x02000148 Trap Number: 133
Binary Images:
0x7ff836115000 - 0x7ff83614eff7 libsystem_kernel.dylib () <0c2fd2c9-777c-3355-b70f-7b1b6e9d1b0b>
/usr/lib/system/libsystem_kernel.dylib
0x7ff836170000 - 0x7ff83617bff7 libsystem_pthread.dylib () <13b5e252-77d1-31e1-888d-1c5f4426ea87>
/usr/lib/system/libsystem_pthread.dylib
0x7ff8000b5000 - 0x7ff800139ff7 libsystem_c.dylib () <8a60f5c1-ea1f-352b-b778-967be44e3677>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib
0x7ff800248000 - 0x7ff80025dffb libc++abi.dylib ()
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib
0x7ff80002c000 - 0x7ff80005ffe9 libobjc.A.dylib () <2a7a213a-fdb2-311c-81d7-efdfd9ddf25a>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib
0x7ff800303000 - 0x7ff80068bffc com.apple.CoreFoundation (6.9) <2be0f79f-8b25-3614-9e7e-dbac565f72dd>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x7ff809cae000 - 0x7ff809cb5ff2 com.apple.GraphicsServices (1.0) <16365e42-1d5c-363d-84d1-3bb290a43253>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1110df000 - 0x112baafff com.apple.UIKitCore (1.0)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x10a695000 - 0x10a69afff com.apple.test.DeviceAgent-Runner (2.2.3)
<21a4d4bc-72d4-3a0e-9786-17e33f61a799>
/Users/USER/Library/Developer/CoreSimulator/Devices/3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952/data/Containers/Bundle/Application/96AEC496-0C00-46F8-82DD-53187D30D145/DeviceAgent-Runner.app/DeviceAgent-Runner
0x10a84d000 - 0x10a8acfff dyld_sim () <6fb74554-3370-3677-93d4-7f7a01ea6a80>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
0x1167c5000 - 0x11685cfff dyld () <28fd2071-57f3-3873-87bf-e4f674a82de6> /usr/lib/dyld
0x7ff809cb6000 - 0x7ff809e5dff1 com.apple.AccessibilityUtilities (1.0.0)
<50cb8d29-b910-3d47-9032-8587768224fa>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities
0x7ff80013a000 - 0x7ff800185ff3 libdispatch.dylib () <59be51c1-e9f3-3a60-8108-cd70ae082897>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib
0x7ff8006fe000 - 0x7ff80102eff4 com.apple.Foundation (6.9) <86cd050d-44fc-3045-a1f3-8ad5047b329e>
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation
0x10ac01000 - 0x10acf5fff com.apple.dt.XCTest (1.0)
/Users/USER/Library/Developer/CoreSimulator/Devices/3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952/data/Containers/Bundle/Application/96AEC496-0C00-46F8-82DD-53187D30D145/DeviceAgent-Runner.app/Frameworks/XCTest.framework/XCTest
EOF
----------- Full Report
{"app_name":"DeviceAgent-Runner","timestamp":"2023-01-10 16:15:23.00
-0500","app_version":"2.2.3","slice_uuid":"21a4d4bc-72d4-3a0e-9786-17e33f61a799","build_version":"1605115037","platform":7,"bundleID":"com.apple.test.DeviceAgent-Runner","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS
13.0.1 (22A400)","roots_installed":0,"name":"DeviceAgent-Runner","incident_id":"42E3018F-F6AD-4A2D-BC85-F56CF5043C19"}
{ "uptime" : 310000, "procRole" : "Non UI", "version" : 2,
"userID" : 501, "deployVersion" : 210, "modelCode" :
"MacBookPro16,1", "coalitionID" : 28614, "osVersion" : {
"train" : "macOS 13.0.1",
"build" : "22A400",
"releaseType" : "User" }, "captureTime" : "2023-01-10 16:15:23.1423 -0500", "incident" :
"42E3018F-F6AD-4A2D-BC85-F56CF5043C19", "pid" : 81642, "cpuType" :
"X86-64", "roots_installed" : 0, "bug_type" : "309",
"procLaunch" : "2023-01-10 16:15:22.7223 -0500", "procStartAbsTime"
: 317186299226018, "procExitAbsTime" : 317186718671602, "procName"
: "DeviceAgent-Runner", "procPath" :
"/Users/USER/Library/Developer/CoreSimulator/Devices/3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952/data/Containers/Bundle/Application/96AEC496-0C00-46F8-82DD-53187D30D145/DeviceAgent-Runner.app/DeviceAgent-Runner",
"bundleInfo" :
{"CFBundleShortVersionString":"2.2.3","CFBundleVersion":"1605115037","CFBundleIdentifier":"com.apple.test.DeviceAgent-Runner"},
"storeInfo" :
{"deviceIdentifierForVendor":"37FA7600-3C07-5A77-BDA0-2BC56C48EE9E","thirdParty":true},
"parentProc" : "launchd_sim", "parentPid" : 81025, "coalitionName"
:
"com.apple.CoreSimulator.SimDevice.3C0B5D32-8722-4A1C-BA6B-C13B3E3D3952",
"crashReporterKey" : "CEC4770B-BEBD-CF8B-2D6A-E9045B038C60",
"responsiblePid" : 1005, "responsibleProc" : "SimulatorTrampoline",
"wakeTime" : 2282, "bridgeVersion" :
{"build":"20P420","train":"7.0"}, "sleepWakeUUID" :
"0F2539EC-DDFE-4381-82F1-C578B4701148", "sip" : "enabled",
"exception" : {"codes":"0x0000000000000000,
0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
"asiBacktraces" : ["0 CoreFoundation
0x00007ff8004288ab __exceptionPreprocess + 242\n1 libobjc.A.dylib
0x00007ff80004dba3 objc_exception_throw + 48\n2 Foundation
0x00007ff800b87271 -[NSMutableDictionary(NSMutableDictionary)
classForCoder] + 0\n3 XCTest
0x000000010ac8c700 _XCTestMain + 761\n4 DeviceAgent-Runner
0x000000010a69702d -[_XCTRunnerAppDelegate
applicationWillResignActive:] + 0\n5 DeviceAgent-Runner
0x000000010a696f2b _XCTRunnerRunTests + 0\n6 CoreFoundation
0x00007ff800387dd9 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12\n7
CoreFoundation 0x00007ff800387592
__CFRunLoopDoBlocks + 406\n8 CoreFoundation 0x00007ff800381e38 __CFRunLoopRun + 948\n9 CoreFoundation
0x00007ff8003816a7 CFRunLoopRunSpecific + 560\n10 GraphicsServices
0x00007ff809cb128a GSEventRunModal + 139\n11 UIKitCore
0x0000000111f20ad3 -[UIApplication _run] + 994\n12 UIKitCore
0x0000000111f259ef UIApplicationMain + 123\n13 DeviceAgent-Runner
0x000000010a6971f5 main + 183\n14 dyld
0x000000010a84f2bf start_sim + 10\n15 ???
0x00000001167cb310 0x0 + 4672238352"], "extMods" :
{"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":18},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"lastExceptionBacktrace" :
[{"imageOffset":1202331,"symbol":"__exceptionPreprocess","symbolLocation":226,"imageIndex":5},{"imageOffset":138147,"symbol":"objc_exception_throw","symbolLocation":48,"imageIndex":4},{"imageOffset":4756081,"symbol":"-[NSMutableDictionary(NSMutableDictionary)
classForCoder]","symbolLocation":0,"imageIndex":13},{"imageOffset":571136,"symbol":"_XCTestMain","symbolLocation":761,"imageIndex":14},{"imageOffset":8237,"symbol":"-[_XCTRunnerAppDelegate
applicationWillResignActive:]","symbolLocation":0,"imageIndex":8},{"imageOffset":7979,"symbol":"_XCTRunnerRunTests","symbolLocation":0,"imageIndex":8},{"imageOffset":544217,"symbol":"CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK","symbolLocation":12,"imageIndex":5},{"imageOffset":542098,"symbol":"__CFRunLoopDoBlocks","symbolLocation":406,"imageIndex":5},{"imageOffset":519736,"symbol":"__CFRunLoopRun","symbolLocation":948,"imageIndex":5},{"imageOffset":517799,"symbol":"CFRunLoopRunSpecific","symbolLocation":560,"imageIndex":5},{"imageOffset":12938,"symbol":"GSEventRunModal","symbolLocation":139,"imageIndex":6},{"imageOffset":14949075,"symbol":"-[UIApplication
_run]","symbolLocation":994,"imageIndex":7},{"imageOffset":14969327,"symbol":"UIApplicationMain","symbolLocation":123,"imageIndex":7},{"imageOffset":8693,"symbol":"main","symbolLocation":183,"imageIndex":8},{"imageOffset":8895,"symbol":"start_sim","symbolLocation":10,"imageIndex":9},{"imageOffset":25360,"symbol":"start","symbolLocation":2432,"imageIndex":10}],
"faultingThread" : 0, "threads" :
[{"triggered":true,"id":3080438,"threadState":{"r13":{"value":206158430216},"rax":{"value":0},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":6},"rsi":{"value":6},"r8":{"value":140701879141904},"cr2":{"value":140703129874270},"rdx":{"value":0},"r10":{"value":0},"r9":{"value":140701879142512},"r15":{"value":22},"rbx":{"value":4672885440,"symbolLocation":0,"symbol":"_main_thread"},"trap":{"value":133},"err":{"value":33554760},"r11":{"value":582},"rip":{"value":140704035754766,"matchesCrashFrame":1},"rbp":{"value":140701879142256},"rsp":{"value":140701879142216},"r12":{"value":259},"rcx":{"value":140701879142216},"flavor":"x86_THREAD_STATE","rdi":{"value":259}},"queue":"com.apple.main-thread","frames":[{"imageOffset":33550,"symbol":"__pthread_kill","symbolLocation":10,"imageIndex":0},{"imageOffset":24443,"symbol":"pthread_kill","symbolLocation":263,"imageIndex":1},{"imageOffset":516064,"symbol":"abort","symbolLocation":130,"imageIndex":2},{"imageOffset":67394,"symbol":"abort_message","symbolLocation":241,"imageIndex":3},{"imageOffset":6493,"symbol":"demangling_terminate_handler()","symbolLocation":266,"imageIndex":3},{"imageOffset":24706,"symbol":"_objc_terminate()","symbolLocation":96,"imageIndex":4},{"imageOffset":64357,"symbol":"std::__terminate(void
(*)())","symbolLocation":8,"imageIndex":3},{"imageOffset":74660,"symbol":"__cxa_rethrow","symbolLocation":99,"imageIndex":3},{"imageOffset":138509,"symbol":"objc_exception_rethrow","symbolLocation":37,"imageIndex":4},{"imageOffset":517993,"symbol":"CFRunLoopRunSpecific","symbolLocation":754,"imageIndex":5},{"imageOffset":12938,"symbol":"GSEventRunModal","symbolLocation":139,"imageIndex":6},{"imageOffset":14949075,"symbol":"-[UIApplication
_run]","symbolLocation":994,"imageIndex":7},{"imageOffset":14969327,"symbol":"UIApplicationMain","symbolLocation":123,"imageIndex":7},{"imageOffset":8693,"symbol":"main","symbolLocation":183,"imageIndex":8},{"imageOffset":8895,"symbol":"start_sim","symbolLocation":10,"imageIndex":9},{"imageOffset":25360,"symbol":"start","symbolLocation":2432,"imageIndex":10}]},{"id":3080469,"frames":[{"imageOffset":7256,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":3080470,"queue":"AXCodeLoader","frames":[{"imageOffset":381054,"symbol":"-[__NSCFString
retain]","symbolLocation":5,"imageIndex":5},{"imageOffset":580687,"symbol":"-[AXCodeLoader
_accessibilityCodeItemMatchingName:type:path:]","symbolLocation":703,"imageIndex":11},{"imageOffset":581534,"symbol":"-[AXCodeLoader
_associateAccessibilityCodeItemWithLoadedCodeItem:]","symbolLocation":334,"imageIndex":11},{"imageOffset":572225,"symbol":"__36-[AXCodeLoader
_addTrackedCodeItem:]_block_invoke","symbolLocation":273,"imageIndex":11},{"imageOffset":6139,"symbol":"_dispatch_call_block_and_release","symbolLocation":12,"imageIndex":12},{"imageOffset":10810,"symbol":"_dispatch_client_callout","symbolLocation":8,"imageIndex":12},{"imageOffset":41798,"symbol":"_dispatch_lane_serial_drain","symbolLocation":949,"imageIndex":12},{"imageOffset":45027,"symbol":"_dispatch_lane_invoke","symbolLocation":400,"imageIndex":12},{"imageOffset":97094,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":870,"imageIndex":12},{"imageOffset":11491,"symbol":"_pthread_wqthread","symbolLocation":326,"imageIndex":1},{"imageOffset":7271,"symbol":"start_wqthread","symbolLocation":15,"imageIndex":1}]},{"id":3080471,"frames":[{"imageOffset":7256,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":3080472,"name":"com.apple.uikit.eventfetch-thread","frames":[{"imageOffset":5794,"symbol":"mach_msg2_trap","symbolLocation":10,"imageIndex":0},{"imageOffset":63101,"symbol":"mach_msg2_internal","symbolLocation":82,"imageIndex":0},{"imageOffset":34586,"symbol":"mach_msg_overwrite","symbolLocation":723,"imageIndex":0},{"imageOffset":6537,"symbol":"mach_msg","symbolLocation":19,"imageIndex":0},{"imageOffset":542862,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":145,"imageIndex":5},{"imageOffset":520159,"symbol":"__CFRunLoopRun","symbolLocation":1371,"imageIndex":5},{"imageOffset":517799,"symbol":"CFRunLoopRunSpecific","symbolLocation":560,"imageIndex":5},{"imageOffset":5605556,"symbol":"-[NSRunLoop(NSRunLoop)
runMode:beforeDate:]","symbolLocation":213,"imageIndex":13},{"imageOffset":5606189,"symbol":"-[NSRunLoop(NSRunLoop)
runUntilDate:]","symbolLocation":72,"imageIndex":13},{"imageOffset":15823494,"symbol":"-[UIEventFetcher
threadMain]","symbolLocation":535,"imageIndex":7},{"imageOffset":5775643,"symbol":"NSThread__start","symbolLocation":1009,"imageIndex":13},{"imageOffset":25177,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":1},{"imageOffset":7291,"symbol":"thread_start","symbolLocation":15,"imageIndex":1}]},{"id":3080473,"frames":[{"imageOffset":7256,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":3080474,"frames":[{"imageOffset":7256,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]}],
"usedImages" : [ {
"source" : "P",
"arch" : "x86_64",
"base" : 140704035721216,
"size" : 237560,
"uuid" : "0c2fd2c9-777c-3355-b70f-7b1b6e9d1b0b",
"path" : "/usr/lib/system/libsystem_kernel.dylib",
"name" : "libsystem_kernel.dylib" }, {
"source" : "P",
"arch" : "x86_64",
"base" : 140704036093952,
"size" : 49144,
"uuid" : "13b5e252-77d1-31e1-888d-1c5f4426ea87",
"path" : "/usr/lib/system/libsystem_pthread.dylib",
"name" : "libsystem_pthread.dylib" }, {
"source" : "P",
"arch" : "x86_64",
"base" : 140703129358336,
"size" : 544760,
"uuid" : "8a60f5c1-ea1f-352b-b778-967be44e3677",
"path" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib",
"name" : "libsystem_c.dylib" }, {
"source" : "P",
"arch" : "x86_64",
"base" : 140703131009024,
"size" : 90108,
"uuid" : "ae8cbd53-0926-3251-b648-6f32d9330a50",
"path" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib",
"name" : "libc++abi.dylib" }, {
"source" : "P",
"arch" : "x86_64",
"base" : 140703128797184,
"size" : 212970,
"uuid" : "2a7a213a-fdb2-311c-81d7-efdfd9ddf25a",
"path" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib",
"name" : "libobjc.A.dylib" }, {
"source" : "P",
"arch" : "x86_64",
"base" : 140703131774976,
"CFBundleShortVersionString" : "6.9",
"CFBundleIdentifier" : "com.apple.CoreFoundation",
"size" : 3706877,
"uuid" : "2be0f79f-8b25-3614-9e7e-dbac565f72dd",
"path" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",
EDIT
I noticed in the logs of the test result window:
023-01-10 21:04:33.843 DeviceAgent-Runner[90901:3282302] Running
tests... 2023-01-10 21:04:33.845 DeviceAgent-Runner[90901:3282302]
Unable to load configuration data from specified path ; error: The
file name is invalid. 2023-01-10 21:04:33.845
DeviceAgent-Runner[90901:3282302] Unable to load configuration data
from specified path ; error: The file name is invalid. 2023-01-10
21:04:33.848 DeviceAgent-Runner[90901:3282302] Found most recent test
bundle at NSBundle
</Users/drake/Library/Developer/CoreSimulator/Devices/B7B33614-1706-4361-8A0F-EE12175686CC/data/Containers/Bundle/Application/8CD92CE7-5550-4E8A-99B8-BCC0DD6147F9/DeviceAgent-Runner.app/PlugIns/DeviceAgent.xctest>
(not yet loaded) 2023-01-10 21:04:33.848
DeviceAgent-Runner[90901:3282302] Found most recent test configuration
in bundle:
/Users/drake/Library/Developer/CoreSimulator/Devices/B7B33614-1706-4361-8A0F-EE12175686CC/data/Containers/Bundle/Application/8CD92CE7-5550-4E8A-99B8-BCC0DD6147F9/DeviceAgent-Runner.app/PlugIns/DeviceAgent.xctest/CBX.xctestconfiguration
2023-01-10 21:04:33.850 DeviceAgent-Runner[90901:3282302] clearing out
IDE related attributes 2023-01-10 21:04:33.850
DeviceAgent-Runner[90901:3282302] Running with configuration
<XCTestConfiguration: 0x600000a245b0> 2023-01-10 21:04:33.854
DeviceAgent-Runner[90901:3282302] *** Assertion failure in void
_XCTestMain(XCTestConfiguration *__strong _Nonnull)(), /Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-14460.20/Sources/XCTestFramework/Harness/XCTestMain.m:213
2023-01-10 21:04:33.856 DeviceAgent-Runner[90901:3282302] ***
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'No test bundle found at
file:///private/var/containers/Bundle/Application/21A83AF9-FACE-FACE-FACE-00605F990879/UITest-Runner.app/PlugIns/UITest.xctest'
2023-01-10 21:04:34.158 xcodebuild[90891:3282023] [MT]
IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2023-01-10 21:04:34.158 xcodebuild[90891:3282023] [MT]
IDETestOperationsObserverDebug: 1.940 elapsed -- Testing started
completed. 2023-01-10 21:04:34.158 xcodebuild[90891:3282023] [MT]
IDETestOperationsObserverDebug: 1.940 sec, +1.940 sec -- end
2023-01-10 21:04:34.217 xcodebuild[90891:3282023] [MT] IDEResultKit:
Warning: While writing a result bundle to
/var/folders/jn/t9rq3scj2v13v8cmvl7kw2h80000gn/T/xdb/logs/2023.01.10.210431/DerivedData/Logs/Test/Test-Transient
Testing-2023.01.10_21-04-32--0500.xcresult, not all contents have been
imported, as the Staging directory still contains the following
files/directories: ["1_Test"]
Do I need to include a path to a configuration somewhere?
EDIT 2
I notice there is no reference to Xamarin.Calabash if I remove the #if ENABLE_TEST_CLOUD. Is there another package I need to add to my project?
Check the location of UITest.xctest. The error message in your edit indicates there is no test bundle.
No test bundle found at file:///private/var/containers/Bundle/Application/21A83AF9-FACE-FACE-FACE-00605F990879/UITest-Runner.app/PlugIns/UITest.xctest
Related
Cannot InsertText with Message App Extension
I'm creating a Message App Extension in Xamarin and am getting a NSException error when trying to InsertText from the MessagesViewController. I do not see error messages when building, just when this InsertText code is executed. Appreciate your help/expertise. InsertText code public void InsertMessage(string message) { ActiveConversation.InsertText(message, (err) => { if (err != null) { Console.WriteLine("ERROR: " + err.ToString()); } }); Console.WriteLine("Inserted text"); } Console Error Message 2022-10-19 14:17:02.869031-0700 MobileSMS[40085:1435095] -[CKIMDaemonController preWarm]: unrecognized selector sent to instance 0x60000326aa80 2022-10-19 14:17:02.871325-0700 MobileSMS[40085:1435095] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CKIMDaemonController preWarm]: unrecognized selector sent to instance 0x60000326aa80' *** First throw call stack: ( 0 CoreFoundation 0x00007ff800427378 __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007ff80004dbaf objc_exception_throw + 48 2 CoreFoundation 0x00007ff800436588 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 3 CoreFoundation 0x00007ff80042b83d ___forwarding___ + 1431 4 CoreFoundation 0x00007ff80042db38 _CF_forwarding_prep_0 + 120 5 IMCore 0x00007ff810903f11 IMCoreSimulatedEnvironmentEnabled + 155997 6 ChatKit 0x00000001098998c0 __46-[CKChatInputController _startEditingPayload:]_block_invoke + 591 7 ChatKit 0x00000001099f25ae __69+[CKComposition compositionWithShelfPluginPayload:completionHandler:]_block_invoke + 115 8 libdispatch.dylib 0x00007ff80013b7fb _dispatch_call_block_and_release + 12 9 libdispatch.dylib 0x00007ff80013ca3a _dispatch_client_callout + 8 10 libdispatch.dylib 0x00007ff80014c32c _dispatch_main_queue_drain + 1338 11 libdispatch.dylib 0x00007ff80014bde4 _dispatch_main_queue_callback_4CF + 31 12 CoreFoundation 0x00007ff8003869f7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 13 CoreFoundation 0x00007ff8003813c6 __CFRunLoopRun + 2482 14 CoreFoundation 0x00007ff800380637 CFRunLoopRunSpecific + 560 15 GraphicsServices 0x00007ff809c0f28a GSEventRunModal + 139 16 UIKitCore 0x00000001145c4425 -[UIApplication _run] + 994 17 UIKitCore 0x00000001145c9301 UIApplicationMain + 123 18 MobileSMS 0x0000000106198220 MobileSMS + 131616 19 dyld 0x00000001063ed2bf start_sim + 10 20 ??? 0x000000010d42a52e 0x0 + 4517438766 ) libc++abi: terminating with uncaught exception of type NSException
The error seems to be related to using the iPhone simulator, as I got it to work on a connected device without any errors.
Cmd+Q crash on SwiftUI MacOS Monterrey App
After distributing a SwiftUI App to some testers they report a crash when exiting the App with keyboard (CMD+Q). I have tried to replicate the same behavior but I am not able to reproduce it, even with the same OS version. It only crashes when exiting through command, if they go through menu -> Exit App it works fine. I have tried to create another menu item to exit and the result is the same, so apparently is something related to the command itself. The App is distributed outside the Mac App Store with Developer ID and I have replicated the same behavior in another App I used to test some SwiftUI layouts. This App was stripped from every feature but a Hello World Swift UI View and it kept crashing. Here is the stack trace: ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: TBBT SwiftUI [32839] Path: /private/var/folders/*/TBBT SwiftUI.app/Contents/MacOS/TBBT SwiftUI Identifier: es.rodrigo.TBBT-SwiftUII Version: 1.0 (1) Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 502 Date/Time: 2022-03-25 12:35:57.9606 +0100 OS Version: macOS 12.2.1 (21D62) Report Version: 12 Anonymous UUID: B5863DFC-2F6F-8EEC-A27D-4C1EBA1A58CB Time Awake Since Boot: 19000 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010 Exception Codes: 0x0000000000000001, 0x0000000000000010 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [32839] VM Region Info: 0x10 is not in any region. Bytes before following region: 4338548720 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 102990000-102994000 [ 16K] r-x/r-x SM=COW .../TBBT SwiftUI Application Specific Information: objc_msgSend() selector name: copy Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x1ab5a8320 objc_msgSend + 32 1 AppKit 0x1ae4f3960 -[NSMenu _populateFromSidebandUpdatersOfSign:withEventRef:] + 84 2 AppKit 0x1ae4f35a4 -[NSMenu _populateWithEventRef:] + 124 3 AppKit 0x1ae61ae94 -[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:] + 372 4 AppKit 0x1ae61ab70 NSSLMMenuEventHandler + 728 5 HIToolbox 0x1b4357418 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1116 6 HIToolbox 0x1b4356884 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 356 7 HIToolbox 0x1b4356714 SendEventToEventTargetWithOptions + 44 8 HIToolbox 0x1b43a8a64 SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char, unsigned char*) + 356 9 HIToolbox 0x1b43a8804 PopulateMenu(MenuData*, OpaqueEventTargetRef*, CheckMenuData*, unsigned int, double) + 128 10 HIToolbox 0x1b43a7f34 Check1MenuForKeyEvent(MenuData*, CheckMenuData*) + 192 11 HIToolbox 0x1b43a7ac4 CheckMenusForKeyEvent(MenuData*, CheckMenuData*) + 576 12 HIToolbox 0x1b43a781c _IsMenuKeyEvent(MenuData*, OpaqueEventRef*, unsigned int, MenuData**, unsigned short*) + 656 13 HIToolbox 0x1b43a7554 IsMenuKeyEvent + 136 14 AppKit 0x1ae7d5fc8 +[NSCarbonMenuImpl _menuItemWithKeyEquivalentMatchingEventRef:inMenu:includingDisabledItems:] + 204 15 AppKit 0x1ae61a718 _NSFindMenuItemMatchingCommandKeyEvent + 208 16 AppKit 0x1ae635f24 -[NSMenu performKeyEquivalent:] + 376 17 AppKit 0x1aeaaa65c routeKeyEquivalent + 580 18 AppKit 0x1ae4abd30 -[NSApplication(NSEvent) sendEvent:] + 1176 19 AppKit 0x1ae765010 -[NSApplication _handleEvent:] + 76 20 AppKit 0x1ae32d9dc -[NSApplication run] + 636 21 AppKit 0x1ae2ff088 NSApplicationMain + 1064 22 SwiftUI 0x1d02494c4 specialized runApp(_:) + 148 23 SwiftUI 0x1d0d73a40 runApp<A>(_:) + 260 24 SwiftUI 0x1d0803658 static App.main() + 128 25 TBBT SwiftUI 0x102993534 static TBBT_SwiftUIApp.$main() + 24 (TBBT_SwiftUIApp.swift:10) [inlined] 26 TBBT SwiftUI 0x102993534 main + 36 27 dyld 0x102be90f4 start + 520 Thread 1: 0 libsystem_pthread.dylib 0x1ab718010 start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x1ab718010 start_wqthread + 0 Thread 3: 0 libsystem_pthread.dylib 0x1ab718010 start_wqthread + 0 Thread 4:: com.apple.NSEventThread 0 libsystem_kernel.dylib 0x1ab6e1954 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x1ab6e1d00 mach_msg + 76 2 CoreFoundation 0x1ab7e8ed8 __CFRunLoopServiceMachPort + 372 3 CoreFoundation 0x1ab7e7390 __CFRunLoopRun + 1212 4 CoreFoundation 0x1ab7e6734 CFRunLoopRunSpecific + 600 5 AppKit 0x1ae4a9fb0 _NSEventThread + 196 6 libsystem_pthread.dylib 0x1ab71d240 _pthread_start + 148 7 libsystem_pthread.dylib 0x1ab718024 thread_start + 8 Thread 5: 0 libsystem_pthread.dylib 0x1ab718010 start_wqthread + 0 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x00006000027400b4 x1: 0x00000001f5c92979 x2: 0x000000016d46e7a0 x3: 0x000000016d46e7e0 x4: 0x0000000000000010 x5: 0x0000000000000000 x6: 0x000000016d46dd94 x7: 0x000000016d46dd88 x8: 0x000060000323d080 x9: 0x0000000000000001 x10: 0x6ae16000027400b4 x11: 0x0000000000000004 x12: 0x00000000c3000002 x13: 0x0000000000000000 x14: 0x00000000c3000004 x15: 0x0000000000000000 x16: 0x0000000000000000 x17: 0x000000020614d138 x18: 0x0000000110033940 x19: 0x000060000274c8c0 x20: 0x00000001f5c92979 x21: 0x000060000274de80 x22: 0x0000000000000000 x23: 0x00003872f316d080 x24: 0x00000002048079fc x25: 0x0000000000000009 x26: 0x000000016d46ebc0 x27: 0x0000000000000001 x28: 0x0000000000000002 fp: 0x000000016d46ea90 lr: 0x00000001ae4f3960 sp: 0x000000016d46ea60 pc: 0x00000001ab5a8320 cpsr: 0x20001000 far: 0x0000000000000010 esr: 0x92000006 (Data Abort) byte read Translation fault Binary Images: 0x1ab5a2000 - 0x1ab5ddfff libobjc.A.dylib (*) <2eb32e1d-90cb-3256-8681-9034085a06a6> /usr/lib/libobjc.A.dylib 0x1ae2fb000 - 0x1af1b1fff com.apple.AppKit (6.9) <8701760d-31b6-37eb-be77-ffb39921dd22> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x1b434c000 - 0x1b467bfff com.apple.HIToolbox (2.1.1) <b5a3fe9a-833b-3697-ac9c-1e9e8eb11bac> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox 0x1d01b7000 - 0x1d119efff com.apple.SwiftUI (3.3.1) <b5f32ad6-34b1-31d5-bdb5-60ac30e963e6> /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI 0x102990000 - 0x102993fff es.rodrigo.TBBT-SwiftUII (1.0) <0d402cc9-0796-39c6-b71d-9e9a1dbfd998> /private/var/folders/*/TBBT SwiftUI.app/Contents/MacOS/TBBT SwiftUI 0x102be4000 - 0x102c43fff dyld (*) <d21a73ea-79cd-36eb-8ac9-2c5cf5181a27> /usr/lib/dyld 0x1ab716000 - 0x1ab722fff libsystem_pthread.dylib (*) <f7b2eccf-e6f1-3109-ae81-9028c0b8332a> /usr/lib/system/libsystem_pthread.dylib 0x1ab6e0000 - 0x1ab715fff libsystem_kernel.dylib (*) <384945e6-dd71-37e5-9a3d-84fff14a1e60> /usr/lib/system/libsystem_kernel.dylib 0x1ab764000 - 0x1abca7fff com.apple.CoreFoundation (6.9) <35473de6-c433-332c-aee0-013fd5f6d4fd> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ??? External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 21 thread_create: 1 thread_set_state: 760 VM Region Summary: ReadOnly portion of Libraries: Total=997.9M resident=0K(0%) swapped_out_or_unallocated=997.9M(100%) Writable regions: Total=1.6G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.6G(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Accelerate framework 384K 3 Activity Tracing 256K 1 CG backing stores 2944K 8 CG image 96K 3 ColorSync 576K 25 CoreAnimation 256K 11 CoreGraphics 48K 3 CoreUI image data 1136K 8 Foundation 48K 2 Kernel Alloc Once 32K 1 MALLOC 305.8M 52 MALLOC guard page 192K 10 MALLOC_MEDIUM (reserved) 960.0M 8 reserved VM address space (unallocated) MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) STACK GUARD 56.1M 6 Stack 10.6M 6 VM_ALLOCATE 1.0G 15 __AUTH 2401K 250 __AUTH_CONST 17.9M 427 __DATA 11.5M 412 __DATA_CONST 15.1M 433 __DATA_DIRTY 1533K 163 __FONT_DATA 4K 1 __LINKEDIT 575.9M 4 __OBJC_CONST 2565K 201 __OBJC_RO 82.1M 1 __OBJC_RW 3104K 1 __TEXT 422.0M 449 __UNICODE 588K 1 dyld private memory 1024K 1 mapped file 158.7M 23 shared memory 992K 19 =========== ======= ======= TOTAL 3.9G 2549 TOTAL, minus reserved VM space 2.6G 2549 ----------- Full Report ----------- {"app_name":"TBBT SwiftUI","timestamp":"2022-03-25 12:35:58.00 +0100","app_version":"1.0","slice_uuid":"0d402cc9-0796-39c6-b71d-9e9a1dbfd998","build_version":"1","platform":1,"bundleID":"es.rodrigo.TBBT-SwiftUII","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.2.1 (21D62)","incident_id":"829399C8-38C2-49C9-87F9-E011CF03D34A","name":"TBBT SwiftUI"} { "uptime" : 19000, "procLaunch" : "2022-03-25 12:35:45.7386 +0100", "procRole" : "Foreground", "version" : 2, "userID" : 502, "deployVersion" : 210, "modelCode" : "MacBookPro17,1", "procStartAbsTime" : 462229239163, "coalitionID" : 3069, "osVersion" : { "train" : "macOS 12.2.1", "build" : "21D62", "releaseType" : "User" }, "captureTime" : "2022-03-25 12:35:57.9606 +0100", "incident" : "829399C8-38C2-49C9-87F9-E011CF03D34A", "bug_type" : "309", "pid" : 32839, "procExitAbsTime" : 462522162289, "translated" : false, "cpuType" : "ARM-64", "procName" : "TBBT SwiftUI", "procPath" : "\/private\/var\/folders\/*\/TBBT SwiftUI.app\/Contents\/MacOS\/TBBT SwiftUI", "bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1","CFBundleIdentifier":"es.rodrigo.TBBT-SwiftUII"}, "storeInfo" : {"deviceIdentifierForVendor":"AEE05FD5-64A2-50DC-989B-3C01A08912AB","thirdParty":true}, "parentProc" : "launchd", "parentPid" : 1, "coalitionName" : "es.rodrigo.TBBT-SwiftUII", "crashReporterKey" : "B5863DFC-2F6F-8EEC-A27D-4C1EBA1A58CB", "sip" : "enabled", "vmRegionInfo" : "0x10 is not in any region. Bytes before following region: 4338548720\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 102990000-102994000 [ 16K] r-x\/r-x SM=COW ...\/TBBT SwiftUI", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000001, 0x0000000000000010","rawCodes":[1,16],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000010"}, "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":32839}, "vmregioninfo" : "0x10 is not in any region. Bytes before following region: 4338548720\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 102990000-102994000 [ 16K] r-x\/r-x SM=COW ...\/TBBT SwiftUI", "asi" : {"objc":["objc_msgSend() selector name: copy"]}, "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":1,"thread_set_state":760,"task_for_pid":21},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 0, "threads" : [{"triggered":true,"id":254335,"threadState":{"x":[{"value":105553157423284},{"value":8418568569,"objc-selector":"copy"},{"value":6128330656},{"value":6128330720},{"value":16},{"value":0},{"value":6128328084},{"value":6128328072},{"value":105553168945280},{"value":1},{"value":7701542390937682100},{"value":4},{"value":3271557122},{"value":0},{"value":3271557124},{"value":0},{"value":0},{"value":8691962168},{"value":4563614016},{"value":105553157474496},{"value":8418568569,"objc-selector":"copy"},{"value":105553157480064},{"value":0},{"value":62066355785856},{"value":8665463292,"symbolLocation":4,"symbol":"_MergedGlobals"},{"value":9},{"value":6128331712},{"value":1},{"value":2}],"flavor":"ARM_THREAD_STATE64","lr":{"value":7219394912},"cpsr":{"value":536875008},"fp":{"value":6128331408},"sp":{"value":6128331360},"esr":{"value":2449473542,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":7169803040,"matchesCrashFrame":1},"far":{"value":16}},"queue":"com.apple.main-thread","frames":[{"imageOffset":25376,"symbol":"objc_msgSend","symbolLocation":32,"imageIndex":0},{"imageOffset":2066784,"symbol":"-[NSMenu _populateFromSidebandUpdatersOfSign:withEventRef:]","symbolLocation":84,"imageIndex":1},{"imageOffset":2065828,"symbol":"-[NSMenu _populateWithEventRef:]","symbolLocation":124,"imageIndex":1},{"imageOffset":3276436,"symbol":"-[NSCarbonMenuImpl _carbonPopulateEvent:handlerCallRef:]","symbolLocation":372,"imageIndex":1},{"imageOffset":3275632,"symbol":"NSSLMMenuEventHandler","symbolLocation":728,"imageIndex":1},{"imageOffset":46104,"symbol":"DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*)","symbolLocation":1116,"imageIndex":2},{"imageOffset":43140,"symbol":"SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*)","symbolLocation":356,"imageIndex":2},{"imageOffset":42772,"symbol":"SendEventToEventTargetWithOptions","symbolLocation":44,"imageIndex":2},{"imageOffset":379492,"symbol":"SendMenuPopulate(MenuData*, OpaqueEventTargetRef*, unsigned int, double, unsigned int, OpaqueEventRef*, unsigned char, unsigned char*)","symbolLocation":356,"imageIndex":2},{"imageOffset":378884,"symbol":"PopulateMenu(MenuData*, OpaqueEventTargetRef*, CheckMenuData*, unsigned int, double)","symbolLocation":128,"imageIndex":2},{"imageOffset":376628,"symbol":"Check1MenuForKeyEvent(MenuData*, CheckMenuData*)","symbolLocation":192,"imageIndex":2},{"imageOffset":375492,"symbol":"CheckMenusForKeyEvent(MenuData*, CheckMenuData*)","symbolLocation":576,"imageIndex":2},{"imageOffset":374812,"symbol":"_IsMenuKeyEvent(MenuData*, OpaqueEventRef*, unsigned int, MenuData**, unsigned short*)","symbolLocation":656,"imageIndex":2},{"imageOffset":374100,"symbol":"IsMenuKeyEvent","symbolLocation":136,"imageIndex":2},{"imageOffset":5091272,"symbol":"+[NSCarbonMenuImpl _menuItemWithKeyEquivalentMatchingEventRef:inMenu:includingDisabledItems:]","symbolLocation":204,"imageIndex":1},{"imageOffset":3274520,"symbol":"_NSFindMenuItemMatchingCommandKeyEvent","symbolLocation":208,"imageIndex":1},{"imageOffset":3387172,"symbol":"-[NSMenu performKeyEquivalent:]","symbolLocation":376,"imageIndex":1},{"imageOffset":8058460,"symbol":"routeKeyEquivalent","symbolLocation":580,"imageIndex":1},{"imageOffset":1772848,"symbol":"-[NSApplication(NSEvent) sendEvent:]","symbolLocation":1176,"imageIndex":1},{"imageOffset":4628496,"symbol":"-[NSApplication _handleEvent:]","symbolLocation":76,"imageIndex":1},{"imageOffset":207324,"symbol":"-[NSApplication run]","symbolLocation":636,"imageIndex":1},{"imageOffset":16520,"symbol":"NSApplicationMain","symbolLocation":1064,"imageIndex":1},{"imageOffset":599236,"symbol":"specialized runApp(_:)","symbolLocation":148,"imageIndex":3},{"imageOffset":12307008,"symbol":"runApp<A>(_:)","symbolLocation":260,"imageIndex":3},{"imageOffset":6604376,"symbol":"static App.main()","symbolLocation":128,"imageIndex":3},{"symbol":"static TBBT_SwiftUIApp.$main()","inline":true,"imageIndex":4,"imageOffset":13620,"symbolLocation":24,"sourceLine":10,"sourceFile":"TBBT_SwiftUIApp.swift"},{"imageOffset":13620,"sourceFile":"Demo.swift","symbol":"main","symbolLocation":36,"imageIndex":4},{"imageOffset":20724,"symbol":"start","symbolLocation":520,"imageIndex":5}]},{"id":254377,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":254380,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":254387,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]},{"id":254394,"name":"com.apple.NSEventThread","frames":[{"imageOffset":6484,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":7},{"imageOffset":7424,"symbol":"mach_msg","symbolLocation":76,"imageIndex":7},{"imageOffset":544472,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":8},{"imageOffset":537488,"symbol":"__CFRunLoopRun","symbolLocation":1212,"imageIndex":8},{"imageOffset":534324,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":8},{"imageOffset":1765296,"symbol":"_NSEventThread","symbolLocation":196,"imageIndex":1},{"imageOffset":29248,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":6},{"imageOffset":8228,"symbol":"thread_start","symbolLocation":8,"imageIndex":6}]},{"id":254531,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":6}]}], "usedImages" : [ { "source" : "P", "arch" : "arm64e", "base" : 7169777664, "size" : 245760, "uuid" : "2eb32e1d-90cb-3256-8681-9034085a06a6", "path" : "\/usr\/lib\/libobjc.A.dylib", "name" : "libobjc.A.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 7217328128, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.AppKit", "size" : 15429632, "uuid" : "8701760d-31b6-37eb-be77-ffb39921dd22", "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit", "name" : "AppKit", "CFBundleVersion" : "2113.30.116" }, { "source" : "P", "arch" : "arm64e", "base" : 7318323200, "CFBundleShortVersionString" : "2.1.1", "CFBundleIdentifier" : "com.apple.HIToolbox", "size" : 3342336, "uuid" : "b5a3fe9a-833b-3697-ac9c-1e9e8eb11bac", "path" : "\/System\/Library\/Frameworks\/Carbon.framework\/Versions\/A\/Frameworks\/HIToolbox.framework\/Versions\/A\/HIToolbox", "name" : "HIToolbox" }, { "source" : "P", "arch" : "arm64e", "base" : 7786426368, "CFBundleShortVersionString" : "3.3.1", "CFBundleIdentifier" : "com.apple.SwiftUI", "size" : 16678912, "uuid" : "b5f32ad6-34b1-31d5-bdb5-60ac30e963e6", "path" : "\/System\/Library\/Frameworks\/SwiftUI.framework\/Versions\/A\/SwiftUI", "name" : "SwiftUI", "CFBundleVersion" : "3.3.1" }, { "source" : "P", "arch" : "arm64", "base" : 4338548736, "CFBundleShortVersionString" : "1.0", "CFBundleIdentifier" : "es.rodrigo.TBBT-SwiftUII", "size" : 16384, "uuid" : "0d402cc9-0796-39c6-b71d-9e9a1dbfd998", "path" : "\/private\/var\/folders\/*\/TBBT SwiftUI.app\/Contents\/MacOS\/TBBT SwiftUI", "name" : "TBBT SwiftUI", "CFBundleVersion" : "1" }, { "source" : "P", "arch" : "arm64e", "base" : 4340989952, "size" : 393216, "uuid" : "d21a73ea-79cd-36eb-8ac9-2c5cf5181a27", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "source" : "P", "arch" : "arm64e", "base" : 7171301376, "size" : 53248, "uuid" : "f7b2eccf-e6f1-3109-ae81-9028c0b8332a", "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", "name" : "libsystem_pthread.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 7171080192, "size" : 221184, "uuid" : "384945e6-dd71-37e5-9a3d-84fff14a1e60", "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", "name" : "libsystem_kernel.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 7171620864, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.CoreFoundation", "size" : 5521408, "uuid" : "35473de6-c433-332c-aee0-013fd5f6d4fd", "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation", "name" : "CoreFoundation", "CFBundleVersion" : "1856.107" }, { "size" : 0, "source" : "A", "base" : 0, "uuid" : "00000000-0000-0000-0000-000000000000" } ], "sharedCache" : { "base" : 7168131072, "size" : 3091218432, "uuid" : "296eb28e-6aeb-3129-8fa6-feb92261a4eb" }, "vmSummary" : "ReadOnly portion of Libraries: Total=997.9M resident=0K(0%) swapped_out_or_unallocated=997.9M(100%)\nWritable regions: Total=1.6G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.6G(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nAccelerate framework 384K 3 \nActivity Tracing 256K 1 \nCG backing stores 2944K 8 \nCG image 96K 3 \nColorSync 576K 25 \nCoreAnimation 256K 11 \nCoreGraphics 48K 3 \nCoreUI image data 1136K 8 \nFoundation 48K 2 \nKernel Alloc Once 32K 1 \nMALLOC 305.8M 52 \nMALLOC guard page 192K 10 \nMALLOC_MEDIUM (reserved) 960.0M 8 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.1M 6 \nStack 10.6M 6 \nVM_ALLOCATE 1.0G 15 \n__AUTH 2401K 250 \n__AUTH_CONST 17.9M 427 \n__DATA 11.5M 412 \n__DATA_CONST 15.1M 433 \n__DATA_DIRTY 1533K 163 \n__FONT_DATA 4K 1 \n__LINKEDIT 575.9M 4 \n__OBJC_CONST 2565K 201 \n__OBJC_RO 82.1M 1 \n__OBJC_RW 3104K 1 \n__TEXT 422.0M 449 \n__UNICODE 588K 1 \ndyld private memory 1024K 1 \nmapped file 158.7M 23 \nshared memory 992K 19 \n=========== ======= ======= \nTOTAL 3.9G 2549 \nTOTAL, minus reserved VM space 2.6G 2549 \n", "legacyInfo" : { "threadTriggered" : { "queue" : "com.apple.main-thread" } }, "trialInfo" : { "rollouts" : [ { "rolloutId" : "60da5e84ab0ca017dace9abf", "factorPackIds" : { }, "deploymentId" : 240000008 }, { "rolloutId" : "607844aa04477260f58a8077", "factorPackIds" : { "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a" }, "deploymentId" : 240000066 }, { "rolloutId" : "602ad4dac86151000cf27e46", "factorPackIds" : { "SIRI_DICTATION_ASSETS" : "61fb0e87c773c43cde3bb80e" }, "deploymentId" : 240000303 }, { "rolloutId" : "5ffde50ce2aacd000d47a95f", "factorPackIds" : { }, "deploymentId" : 240000123 }, { "rolloutId" : "601d9415f79519000ccd4b69", "factorPackIds" : { "SIRI_TEXT_TO_SPEECH" : "622657ce37186c771d5404ad" }, "deploymentId" : 240000416 }, { "rolloutId" : "5fc94383418129005b4e9ae0", "factorPackIds" : { }, "deploymentId" : 240000287 } ], "experiments" : [ ] } }
Swift + Parse: 'Can't use nil for keys or values on PFObject. Use NSNull for values.'
So I have a Swift application that I am working on (in Xcode 7.3). It uses Parse and in it I have a function that is generating the error message stated in the title. The code appears as follows; #IBAction func callUber(sender: AnyObject) { let riderRequest = PFObject(className:"riderRequest") riderRequest["username"] = PFUser.currentUser()?.username riderRequest["location "] = PFGeoPoint(latitude:latitude, longitude:longitude) riderRequest.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in if (success) { self.callUberButton.setTitle("Cancel Uber", forState: UIControlState.Normal) } else { let alert = UIAlertController(title: "Could not call Uber", message: "Please try again", preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) self.presentViewController(alert, animated: true, completion: nil) } } } Now somewhere in this code nil is being applied to a value, and this causes the error message (or so I think). I have been looking around on SO for solutions to this problem, however I could not find any similar threads for this error message and Swift, only Objective-C. I'm guessing that I have to introduce some sort of error handling or check where I make sure that the value of the object is not nil, however I cant seem to figure out where, or how to apply this. The error is only triggered when I press the "callUber" button, and the full output from the debug console follows below. 2016-04-15 12:21:01.900 ParseStarterProject-Swift[8781:2591354] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't use nil for keys or values on PFObject. Use NSNull for values.' *** First throw call stack: ( 0 CoreFoundation 0x000000010ca98d85 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010eca0deb objc_exception_throw + 48 2 CoreFoundation 0x000000010ca98cbd +[NSException raise:format:] + 205 3 ParseStarterProject-Swift 0x000000010c1042a8 -[PFObject(Private) _setObject:forKey:onlyIfDifferent:] + 122 4 ParseStarterProject-Swift 0x000000010c107d01 -[PFObject setObject:forKey:] + 53 5 ParseStarterProject-Swift 0x000000010c107d46 -[PFObject setObject:forKeyedSubscript:] + 50 6 ParseStarterProject-Swift 0x000000010c0c847f _TFC25ParseStarterProject_Swift19RiderViewController8callUberfPs9AnyObject_T_ + 671 7 ParseStarterProject-Swift 0x000000010c0c89d6 _TToFC25ParseStarterProject_Swift19RiderViewController8callUberfPs9AnyObject_T_ + 54 8 UIKit 0x000000010d726a8d -[UIApplication sendAction:to:from:forEvent:] + 92 9 UIKit 0x000000010d899e67 -[UIControl sendAction:to:forEvent:] + 67 10 UIKit 0x000000010d89a143 -[UIControl _sendActionsForEvents:withEvent:] + 327 11 UIKit 0x000000010d899263 -[UIControl touchesEnded:withEvent:] + 601 12 UIKit 0x000000010d79999f -[UIWindow _sendTouchesForEvent:] + 835 13 UIKit 0x000000010d79a6d4 -[UIWindow sendEvent:] + 865 14 UIKit 0x000000010d745dc6 -[UIApplication sendEvent:] + 263 15 UIKit 0x000000011dfe0b15 -[UIApplicationAccessibility sendEvent:] + 77 16 UIKit 0x000000010d71f553 _UIApplicationHandleEventQueue + 6660 17 CoreFoundation 0x000000010c9be301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 18 CoreFoundation 0x000000010c9b422c __CFRunLoopDoSources0 + 556 19 CoreFoundation 0x000000010c9b36e3 __CFRunLoopRun + 867 20 CoreFoundation 0x000000010c9b30f8 CFRunLoopRunSpecific + 488 21 GraphicsServices 0x0000000111eb0ad2 GSEventRunModal + 161 22 UIKit 0x000000010d724f09 UIApplicationMain + 171 23 ParseStarterProject-Swift 0x000000010c0cc712 main + 114 24 libdyld.dylib 0x000000010f7a792d start + 1 25 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
A couple of things that may be the issue: Double check your class name is "riderRequest", I think "RiderRequest" could possibly be the actual name. Second is to check all your key names are correct by going to the parse dashboard and having a look at your class Last thing is to confirm that all your values for things like username and latitude and longitude are not nil before setting them. Maybe try: if let username = PFUser.currentUser()?.username && latitude != nil && longitude != nil { riderRequest.setObject(username, forKey: "username") riderRequest.setObject(PFGeoPoint(latitude: latitude, longitude: longitude), forKey: "location") //then run the rest of the code as you have been }
nearby places swift 2 error
I work on a ios application that requires to use nearby places api from google. It worked very well with swift but now , when i updated my xcode to xcode 7 and it changed from swift to swift 2 it doesn't work anymore. I am stuck with this , any help will be apreciated . Here is the request for the api : func fetchPlacesNearCoordinate(coordinate: CLLocationCoordinate2D, radius: Double, name : String){ var urlString = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\(44.942149),\(26.02453)&radius=\(radius)&types=food" urlString += "&key=\(apiServerKey)" urlString = urlString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)! if placesTask.taskIdentifier > 0 && placesTask.state == .Running { placesTask.cancel() } UIApplication.sharedApplication().networkActivityIndicatorVisible = true do{ //******************Here's the line that displays error placesTask = session.dataTaskWithURL(NSURL(string: urlString)!) { (data, response, error) -> Void in UIApplication.sharedApplication().networkActivityIndicatorVisible = false //var placesArray = [GooglePlace]() do { if let json = try NSJSONSerialization.JSONObjectWithData(data!, options:[]) as? NSDictionary { if let results = json["results"] as? NSArray { for rawPlace:AnyObject in results { print(rawPlace) var placename = "" if let name = rawPlace["name"] as? NSString { placename = name as String } } } } } catch { //handle error } /*dispatch_async(dispatch_get_main_queue()) { completion(placesArray) }*/ } }catch{ } placesTask.resume() } And the errors i get : 2015-10-02 16:57:54.586 QR Code[4331:67414] -[NSURLSessionDataTask taskIdentifier]: unrecognized selector sent to instance 0x7fe791c3b840 2015-10-02 16:57:54.591 QR Code[4331:67414] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURLSessionDataTask taskIdentifier]: unrecognized selector sent to instance 0x7fe791c3b840' *** First throw call stack:( 0 CoreFoundation 0x0000000111a8ef65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000111506deb objc_exception_throw + 48 2 CoreFoundation 0x0000000111a9758d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x00000001119e4f7a ___forwarding___ + 970 4 CoreFoundation 0x00000001119e4b28 _CF_forwarding_prep_0 + 120 5 QR Code 0x000000010f57b3ff _TFC7QR_Code17MapViewController25fetchPlacesNearCoordinatefS0_FTVSC22CLLocationCoordinate2D6radiusSd4nameSS_T_ + 1215 6 QR Code 0x000000010f57bfd3 _TFC7QR_Code17MapViewController11viewDidLoadfS0_FT_T_ + 1555 7 QR Code 0x000000010f57c552 _TToFC7QR_Code17MapViewController11viewDidLoadfS0_FT_T_ + 34 8 UIKit 0x00000001122ae931 -[UIViewController loadViewIfRequired] + 1344 9 UIKit 0x00000001122b4923 -[UIViewController __viewWillAppear:] + 120 10 UIKit 0x00000001122e418a -[UINavigationController _startCustomTransition:] + 1177 11 UIKit 0x00000001122f37c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 712 12 UIKit 0x00000001122f467d -[UINavigationController __viewWillLayoutSubviews] + 57 13 UIKit 0x000000011248c63d -[UILayoutContainerView layoutSubviews] + 248 14 UIKit 0x00000001121d411c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710 15 QuartzCore 0x000000010fe7536a -[CALayer layoutSublayers] + 146 16 QuartzCore 0x000000010fe69bd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366 17 QuartzCore 0x000000010fe69a4e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 18 QuartzCore 0x000000010fe5e1d5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277 19 QuartzCore 0x000000010fe8b9f0 _ZN2CA11Transaction6commitEv + 508 20 UIKit 0x000000011211e1b6 _UIApplicationHandleEventQueue + 7183 21 CoreFoundation 0x00000001119bb0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 22 CoreFoundation 0x00000001119b0fcc __CFRunLoopDoSources0 + 556 23 CoreFoundation 0x00000001119b0483 __CFRunLoopRun + 867 24 CoreFoundation 0x00000001119afe98 CFRunLoopRunSpecific + 488 25 GraphicsServices 0x0000000115770ad2 GSEventRunModal + 161 26 UIKit 0x0000000112123676 UIApplicationMain + 171 27 QR Code 0x000000010f5782bd main + 109 28 libdyld.dylib 0x0000000113dd192d start + 1) libc++abi.dylib: terminating with uncaught exception of type NSException
Please do not call the Places API Web Services directly from a mobile device - it opens up the potential for external parties to steal your API key from your application. Please follow the Proxy Server pattern laid out in this tutorial by Ray Wenderlich's team.
Creating an OSX PyQt app using Pyinstaller 2, PyQt4 and Qt5
I am trying to package a PyQt program for OSX using PyInstaller 2, where PyQt4 (4.10) has been built against Qt 5.0.2 (from Git). The following simple example doesn't work. import sys from PyQt4.QtGui import QApplication, QMessageBox def main(): print "Hello" a = QApplication(sys.argv) m = QMessageBox(QMessageBox.Information, "Title", "Hello") m.exec_() if __name__=="__main__": main() Spec file generated using pyinstaller-2.0/utils/MakeSpec.py and modified to add the BUNDLE class. a = Analysis(['hello.py'], pathex=['/Users/glenn/rp/src/demo'], hiddenimports=[], hookspath=None) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, exclude_binaries=1, name=os.path.join('build/pyi.darwin/hello', 'hello'), debug=False, strip=None, upx=True, console=False ) coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=None, upx=True, name=os.path.join('dist', 'hello')) app = BUNDLE(coll, name=os.path.join('dist', 'hello.app'), appname="Hello", version = '0.1' ) Packaging command > python pyinstaller.py --windowed hello.spec Running the binary directly from the terminal gives this output before it crashes: $ ./dist/hello.app/Contents/MacOS/hello Hello Failed to load platform plugin "cocoa". Available platforms are: Abort trap: 6 and this is the stack trace: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Application Specific Information: abort() called Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x9a671a6a __pthread_kill + 10 1 libsystem_c.dylib 0x93163b2f pthread_kill + 101 2 libsystem_c.dylib 0x9319a4ec abort + 168 3 QtCore 0x03db156b qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) + 11 4 QtCore 0x03db19df QMessageLogger::fatal(char const*, ...) const + 63 5 QtGui 0x068abceb QGuiApplicationPrivate::createPlatformIntegration() + 3547 6 QtGui 0x068abd16 QGuiApplicationPrivate::createEventDispatcher() + 38 7 QtCore 0x03f4f2c4 QCoreApplication::init() + 100 8 QtCore 0x03f4f23b QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) + 59 9 QtGui 0x068aa0d0 QGuiApplication::QGuiApplication(QGuiApplicationPrivate&) + 32 10 QtWidgets 0x06c695de QApplication::QApplication(int&, char**, int) + 238 11 PyQt4.QtGui.so 0x06394454 init_QApplication + 196 12 sip.so 0x007bc7d5 sipSimpleWrapper_init + 266 13 Python 0x0385c174 type_call + 340 14 Python 0x0380d401 PyObject_Call + 97 15 Python 0x0389c093 PyEval_EvalFrameEx + 10131 16 Python 0x038a0490 fast_function + 192 17 Python 0x0389beae PyEval_EvalFrameEx + 9646 18 Python 0x038998b2 PyEval_EvalCodeEx + 1922 19 Python 0x03899127 PyEval_EvalCode + 87 20 Python 0x038be06e PyRun_StringFlags + 126 21 Python 0x038bdfb1 PyRun_SimpleStringFlags + 81 22 Python 0x038bf619 PyRun_SimpleString + 25 23 hello 0x00003240 runScripts + 240 24 hello 0x0000280a main + 442 25 hello 0x00001eb9 _start + 224 26 hello 0x00001dd8 start + 40 The issue appears to be that it can't find the libqcocoa.dylib plugin. This is not surprising as it is not packaged. Is that the actual issue here and do I need to include this plugin? If so where does it need to go? I have tried putting it in demo.app/Contents/plugins but that doesn't help.
The right place to put libqcocoa.dylib is in Contents/MacOS/qt4_plugins/platforms: extralibs = [("qt4_plugins/platforms/libqcocoa.dylib", "/path/to/libqcocoa.dylib", "BINARY") ] coll = COLLECT(exe, a.binaries + extralibs, a.zipfiles, a.datas, strip=None, upx=False, name=os.path.join('dist', 'hello')) The app now starts but the dialog window never appears. Edit: This is because PyInstaller (v 2.0) adds LSBackgroundOnly=true to the apps Info.plist. Removing this allows the window to show.
Try adding (but changed for PyQt): from PySide import QtCore, QtGui At least that works for me (PySide 1.1.1, Qt 4.8.1, latest dev Pyinstaller, OSX 10.7.5, with no changes to the spec file and --onefile --windowed arguments to pyinstaller.) And without this snippet, it also crashes for me. I suppose that pulls in more dependencies. Found this in another answer.