aws-amplify / amplify-swift

A declarative library for application development using cloud services.
Apache License 2.0
453 stars 196 forks source link

Support SwiftUI Previews from code in Swift packages #1508

Closed brennanMKE closed 2 years ago

brennanMKE commented 2 years ago

Is your feature request related to a problem? Please describe.

When code is in a Swift package it doe not have the .json files required when Amplify.configure is called. It results in an exception which causes Previews to crash. This is because the app has these files included as resources but the Swift package does not.

Describe the solution you'd like

The Amplify.configure command should return silently when it is called while running for SwiftUI Previews.

var isRunningForPreviews: Bool {
    ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] != nil
}

Describe alternatives you've considered

I attempted to configure AWS with a dummy dictionary but that did not work.

Is the feature request related to any of the existing Amplify categories?

No response

Additional context

No response

kierancrown commented 2 years ago

Is there any update on this? I'm unable to preview with Amplify installed.

pedrosolisgarcia commented 2 years ago

Hi @brennanMKE Thanks for actioning this change! I've seen that it has been merged already a while ago, and yet I am experiencing the crashes on my previews.

Is there anything I need to configure additionally so the flag you implemented has effect when rendering previews?

Thanks a lot!!

harsh62 commented 2 years ago

@Pedrosolisg can you share any logs for the crash that you are seeing?

pedrosolisgarcia commented 2 years ago

@Pedrosolisg can you share any logs for the crash that you are seeing?

Thanks for replying to quick! @harsh62 :)

Below the crash report by Xcode when trying to render the Preview on the canvas:

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

Incident Identifier: 4DED7D1A-83C1-409F-9F7A-9467283D906B CrashReporter Key: B17AFC89-7248-A1EE-5B40-4A5F667C3E76 Hardware Model: MacBookPro16,1 Process: Kalisten [67794] Path: /Users/USER/Library/Developer/Xcode/UserData/Previews/Simulator Devices/74D1B278-0DF5-4A83-AB10-35363A4E4ED3/data/Containers/Bundle/Application/FC5DFDC3-367B-45DE-A0F9-9D869287AA82/Kalisten.app/Kalisten Identifier: vilhon.Kalisten Version: 1.03 (1) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [7496] Coalition: com.apple.CoreSimulator.SimDevice.74D1B278-0DF5-4A83-AB10-35363A4E4ED3 [89706] Responsible Process: SimulatorTrampoline [49585]

Date/Time: 2022-05-13 12:29:47.8812 +0200 Launch Time: 2022-05-13 12:29:45.9646 +0200 OS Version: macOS 12.3.1 (21E258) Release Type: User Report Version: 104

Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: SIGNAL 4 Illegal instruction: 4 Terminating Process: exc handler [67794]

Triggered by Thread: 0

Application Specific Information: dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/pedro/Library/Developer/Xcode/DerivedData/Kalisten-ftkebijbwltjslbuajudpftkjaug/Build/Intermediates.noindex/Previews/Kalisten Debug/Products/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot//System/Library/PrivateFrameworks/PreviewsInjection.framework/PreviewsInjection DYLD_FRAMEWORK_PATH=/Users/pedro/Library/Developer/Xcode/DerivedData/Kalisten-ftkebijbwltjslbuajudpftkjaug/Build/Intermediates.noindex/Previews/Kalisten Debug/Products/Debug-iphonesimulator CoreSimulator 802.6 - Device: iPhone 13 (74D1B278-0DF5-4A83-AB10-35363A4E4ED3) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone 13 Amplify/AuthCategory.swift:18: Fatal error: Authentication category is not configured. Call Amplify.configure() before using any methods on the category. dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/pedro/Library/Developer/Xcode/DerivedData/Kalisten-ftkebijbwltjslbuajudpftkjaug/Build/Intermediates.noindex/Previews/Kalisten Debug/Products/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot//System/Library/PrivateFrameworks/PreviewsInjection.framework/PreviewsInjection DYLD_FRAMEWORK_PATH=/Users/pedro/Library/Developer/Xcode/DerivedData/Kalisten-ftkebijbwltjslbuajudpftkjaug/Build/Intermediates.noindex/Previews/Kalisten Debug/Products/Debug-iphonesimulator

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libswiftCore.dylib 0x7fff30982d85 assertionFailure(:_:file:line:flags:) + 421 1 Kalisten 0x10c2bba51 AuthCategory.plugin.getter + 2337 2 Kalisten 0x10c2ba544 AuthCategory.getCurrentUser() + 116 3 Kalisten 0x10bfdd9b7 AuthSessionManager.getCurrentAuthUser() + 215 (AuthSessionManager.swift:27) 4 Kalisten 0x10c17187c KalistenApp.init() + 236 (KalistenApp.swift:25) 5 Kalisten 0x10c1729d1 protocol witness for App.init() in conformance KalistenApp + 17 6 SwiftUI 0x7fff5d390c52 static App.main() + 47 7 Kalisten 0x10c17294e static KalistenApp.$main() + 30 (KalistenApp.swift:14) 8 Kalisten 0x10c1729f9 main + 9 9 dyld_sim 0x10f110f21 start_sim + 10 10 dyld 0x11c3c851e start + 462

Thread 1:: Dispatch queue: APMAnalyticsQueue 0 libnetwork.dylib 0x7fff2297bfc2 nw_resolver_get_next_log_id + 34 1 libnetwork.dylib 0x7fff2297b700 -[NWConcrete_nw_resolver initWithEndpoint:parameters:path:log_str:] + 1792 2 libnetwork.dylib 0x7fff2297c7b3 nw_resolver_create_with_path + 115 3 SystemConfiguration 0x7fff206bd2b3 SCNetworkReachabilityRestartResolver + 111 4 SystemConfiguration 0x7fff206bc32e SCNetworkReachabilitySetDispatchQueue + 956 5 SystemConfiguration 0x7fff206bbe08 SCNetworkReachabilityScheduleWithRunLoop + 510 6 Kalisten 0x10c6250c2 -[GULReachabilityChecker start] + 322 7 Kalisten 0x10c626d97 -[GULNetwork initWithReachabilityHost:] + 231 8 Kalisten 0x10c9265b0 -[APMETaskManager init] + 175 9 Kalisten 0x10c921078 -[APMEManager init] + 45 10 Kalisten 0x10c920f10 29+[APMEManager sharedInstance]_block_invoke + 37 11 libdispatch.dylib 0x7fff20115b25 _dispatch_client_callout + 8 12 libdispatch.dylib 0x7fff20116cdd _dispatch_once_callout + 20 13 Kalisten 0x10c920ee9 +[APMEManager sharedInstance] + 46 14 Kalisten 0x10c93ebf2 +[APMMeasurement initializeSharedInstanceWithAppID:isAnalyticsCollectionEnabled:isAnalyticsCollectionDeactivated:safelistedEvents:] + 168 15 Kalisten 0x10c8f9e2b 46+[APMAnalytics startWithAppID:origin:options:]_block_invoke_2 + 56 16 libdispatch.dylib 0x7fff201148e4 _dispatch_call_block_and_release + 12 17 libdispatch.dylib 0x7fff20115b25 _dispatch_client_callout + 8 18 libdispatch.dylib 0x7fff2011c0df _dispatch_lane_serial_drain + 753 19 libdispatch.dylib 0x7fff2011ccc1 _dispatch_lane_invoke + 400 20 libdispatch.dylib 0x7fff2012797b _dispatch_workloop_worker_thread + 779 21 libsystem_pthread.dylib 0x7fff6fb05fd0 _pthread_wqthread + 326 22 libsystem_pthread.dylib 0x7fff6fb04f57 start_wqthread + 15

Thread 2: 0 libsystem_pthread.dylib 0x7fff6fb04f48 start_wqthread + 0

Thread 3:: Dispatch queue: com.firebase.FIRInstallationsStore 0 libsystem_kernel.dylib 0x7fff6faaa97a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x7fff6faaace8 mach_msg + 56 2 libdispatch.dylib 0x7fff2012e5ac _dispatch_mach_send_and_wait_for_reply + 567 3 libdispatch.dylib 0x7fff2012e997 dispatch_mach_send_with_result_and_wait_for_reply + 55 4 libxpc.dylib 0x7fff20061bb4 xpc_connection_send_message_with_reply_sync + 219 5 CoreFoundation 0x7fff2042e65f 104-[CFPrefsSearchListSource synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:]_block_invoke_2 + 28 6 CoreFoundation 0x7fff2046dca5 -[_CFXPreferences withConnectionForRole:performBlock:] + 33 7 CoreFoundation 0x7fff2042e628 104-[CFPrefsSearchListSource synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:]_block_invoke + 105 8 CoreFoundation 0x7fff2042e4f0 CFPREFERENCES_IS_WAITING_FOR_SYSTEM_CFPREFSD + 74 9 CoreFoundation 0x7fff2042bf9f -[CFPrefsSearchListSource synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:] + 263 10 CoreFoundation 0x7fff2042e82d -[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:] + 198 11 CoreFoundation 0x7fff2042d036 -[CFPrefsSearchListSource alreadylocked_getDictionary:] + 375 12 CoreFoundation 0x7fff2042cbca -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 150 13 CoreFoundation 0x7fff203cc66b -[CFPrefsSource copyValueForKey:] + 47 14 CoreFoundation 0x7fff204709cd __76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke + 32 15 CoreFoundation 0x7fff204301ef 108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 395 16 CoreFoundation 0x7fff2042f8ee normalizeQuintuplet + 322 17 CoreFoundation 0x7fff20430048 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 121 18 CoreFoundation 0x7fff204708b3 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 137 19 CoreFoundation 0x7fff204732fa _CFPreferencesCopyAppValueWithContainerAndConfiguration + 101 20 Kalisten 0x10c60840d -[GULUserDefaults objectForKey:] + 349 21 Kalisten 0x10c61c092 60-[FIRInstallationsStore installationExistsForAppID:appName:]_block_invoke + 98 22 Kalisten 0x10c5c71a6 __38+[FBLPromise(DoAdditions) onQueue:do:]_block_invoke + 54 23 libdispatch.dylib 0x7fff201148e4 _dispatch_call_block_and_release + 12 24 libdispatch.dylib 0x7fff20115b25 _dispatch_client_callout + 8 25 libdispatch.dylib 0x7fff2011c203 _dispatch_lane_serial_drain + 1045 26 libdispatch.dylib 0x7fff2011ccc1 _dispatch_lane_invoke + 400 27 libdispatch.dylib 0x7fff2012797b _dispatch_workloop_worker_thread + 779 28 libsystem_pthread.dylib 0x7fff6fb05fd0 _pthread_wqthread + 326 29 libsystem_pthread.dylib 0x7fff6fb04f57 start_wqthread + 15

Thread 4: 0 libsystem_pthread.dylib 0x7fff6fb04f48 start_wqthread + 0

Thread 5: 0 libsystem_pthread.dylib 0x7fff6fb04f48 start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000200000003 rbx: 0x000000010c9b06f0 rcx: 0xfffffffe00000000 rdx: 0x0000000000000003 rdi: 0x0000600000a4cb08 rsi: 0x000060000185a100 rbp: 0x00007ff7b40065f0 rsp: 0x00007ff7b40065a0 r8: 0x0000000000002100 r9: 0x0000000000000080 r10: 0x00000000000007fb r11: 0x000000000000007f r12: 0x000000000000006d r13: 0x0000000000000012 r14: 0x0000600000a4cb00 r15: 0x000000000000000b rip: 0x00007fff30982d85 rfl: 0x0000000000010246 cr2: 0x0000700007d9df00

Logical CPU: 4 Error Code: 0x00000000 Trap Number: 6

Binary Images: 0x7fff30954000 - 0x7fff30ddafff libswiftCore.dylib () /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCore.dylib 0x10bef7000 - 0x10cadafff vilhon.Kalisten (1.03) /Users/USER/Library/Developer/Xcode/UserData/Previews/Simulator Devices/74D1B278-0DF5-4A83-AB10-35363A4E4ED3/data/Containers/Bundle/Application/FC5DFDC3-367B-45DE-A0F9-9D869287AA82/Kalisten.app/Kalisten 0x7fff5cf58000 - 0x7fff5dde7fff com.apple.SwiftUI (3.4.12) <1f4075a1-4d0c-3c72-a76a-91300689360e> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUI.framework/SwiftUI 0x10f10f000 - 0x10f15cfff dyld_sim () /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim 0x11c3c3000 - 0x11c42efff dyld () /usr/lib/dyld 0x7fff22778000 - 0x7fff23058fff libnetwork.dylib () <153ece42-6d68-369f-8a04-6909f9e30059> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib 0x7fff20695000 - 0x7fff20703fff com.apple.SystemConfiguration (1.21) <404b9836-0b78-33b0-814f-2801093279c7> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration 0x7fff20113000 - 0x7fff20159fff libdispatch.dylib () <2020b811-1706-3efe-8226-a9906bb69f52> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib 0x7fff6fb03000 - 0x7fff6fb0efff libsystem_pthread.dylib () <2f6c275d-7e14-3d31-a924-e1bb41d2415f> /usr/lib/system/libsystem_pthread.dylib 0x7fff6faa9000 - 0x7fff6fae0fff libsystem_kernel.dylib () <26a59789-b846-3ed4-96dc-8dbef3c0c8e7> /usr/lib/system/libsystem_kernel.dylib 0x7fff20057000 - 0x7fff2008afff libxpc.dylib () <3766ec43-ad39-3003-87ce-c54d4f64d800> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib 0x7fff202f1000 - 0x7fff20694fff com.apple.CoreFoundation (6.9) <6cd8003f-fe68-3e98-8a29-cc834000fffd> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

EOF


Full Report

{"app_name":"Kalisten","timestamp":"2022-05-13 12:29:48.00 +0200","app_version":"1.03","slice_uuid":"c3c37920-d04f-3170-9314-6c1317292a41","build_version":"1","platform":7,"bundleID":"vilhon.Kalisten","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.3.1 (21E258)","incident_id":"4DED7D1A-83C1-409F-9F7A-9467283D906B","name":"Kalisten"} { "uptime" : 730000, "procLaunch" : "2022-05-13 12:29:45.9646 +0200", "procRole" : "Foreground", "version" : 2, "userID" : 502, "deployVersion" : 210, "modelCode" : "MacBookPro16,1", "procStartAbsTime" : 734262405904926, "coalitionID" : 89706, "osVersion" : { "train" : "macOS 12.3.1", "build" : "21E258", "releaseType" : "User" }, "captureTime" : "2022-05-13 12:29:47.8812 +0200", "incident" : "4DED7D1A-83C1-409F-9F7A-9467283D906B", "bug_type" : "309", "pid" : 67794, "procExitAbsTime" : 734264305713255, "cpuType" : "X86-64", "procName" : "Kalisten", "procPath" : "\/Users\/USER\/Library\/Developer\/Xcode\/UserData\/Previews\/Simulator Devices\/74D1B278-0DF5-4A83-AB10-35363A4E4ED3\/data\/Containers\/Bundle\/Application\/FC5DFDC3-367B-45DE-A0F9-9D869287AA82\/Kalisten.app\/Kalisten", "bundleInfo" : {"CFBundleShortVersionString":"1.03","CFBundleVersion":"1","CFBundleIdentifier":"vilhon.Kalisten"}, "storeInfo" : {"deviceIdentifierForVendor":"461AF5D9-BB50-5877-A690-F0C3105A2F9A","thirdParty":true}, "parentProc" : "launchd_sim", "parentPid" : 7496, "coalitionName" : "com.apple.CoreSimulator.SimDevice.74D1B278-0DF5-4A83-AB10-35363A4E4ED3", "crashReporterKey" : "B17AFC89-7248-A1EE-5B40-4A5F667C3E76", "responsiblePid" : 49585, "responsibleProc" : "SimulatorTrampoline", "wakeTime" : 349279, "bridgeVersion" : {"build":"19P4243","train":"6.4"}, "sleepWakeUUID" : "11DFC744-8703-4F34-BE9D-EC7B0096327B", "sip" : "enabled", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000001, 0x0000000000000000","rawCodes":[1,0],"type":"EXC_BAD_INSTRUCTION","signal":"SIGILL"}, "termination" : {"flags":0,"code":4,"namespace":"SIGNAL","indicator":"Illegal instruction: 4","byProc":"exc handler","byPid":67794}, "asi" : {"dyld_sim":["dyld4 config: DYLD_ROOT_PATH=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot DYLD_LIBRARY_PATH=\/Users\/pedro\/Library\/Developer\/Xcode\/DerivedData\/Kalisten-ftkebijbwltjslbuajudpftkjaug\/Build\/Intermediates.noindex\/Previews\/Kalisten Debug\/Products\/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/\/System\/Library\/PrivateFrameworks\/PreviewsInjection.framework\/PreviewsInjection DYLD_FRAMEWORK_PATH=\/Users\/pedro\/Library\/Developer\/Xcode\/DerivedData\/Kalisten-ftkebijbwltjslbuajudpftkjaug\/Build\/Intermediates.noindex\/Previews\/Kalisten Debug\/Products\/Debug-iphonesimulator"],"libsystem_sim_platform.dylib":["CoreSimulator 802.6 - Device: iPhone 13 (74D1B278-0DF5-4A83-AB10-35363A4E4ED3) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone 13"],"libswiftCore.dylib":["Amplify\/AuthCategory.swift:18: Fatal error: Authentication category is not configured. Call Amplify.configure() before using any methods on the category."],"dyld":["dyld4 config: DYLD_ROOT_PATH=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot DYLD_LIBRARY_PATH=\/Users\/pedro\/Library\/Developer\/Xcode\/DerivedData\/Kalisten-ftkebijbwltjslbuajudpftkjaug\/Build\/Intermediates.noindex\/Previews\/Kalisten Debug\/Products\/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/\/System\/Library\/PrivateFrameworks\/PreviewsInjection.framework\/PreviewsInjection DYLD_FRAMEWORK_PATH=\/Users\/pedro\/Library\/Developer\/Xcode\/DerivedData\/Kalisten-ftkebijbwltjslbuajudpftkjaug\/Build\/Intermediates.noindex\/Previews\/Kalisten Debug\/Products\/Debug-iphonesimulator"]}, "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":14555,"task_for_pid":326},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 0, "threads" : [{"triggered":true,"id":17514506,"instructionState":{"instructionStream":{"bytes":[0,0,72,184,0,0,0,0,0,0,0,16,73,133,196,15,132,192,1,0,0,72,131,192,255,76,137,247,72,33,199,72,131,199,32,72,184,255,255,255,255,255,255,0,0,73,33,196,72,131,236,8,68,15,182,69,24,76,137,230,72,139,85,208,72,139,77,16,73,137,217,139,69,40,80,65,85,65,87,232,23,18,0,0,72,131,196,32,76,137,247,232,235,176,49,0,15,11,72,131,236,8,72,141,5,222,167,66,0,72,141,61,171,162,66,0,72,141,13,192,165,66,0,190,11,0,0,0,65,184,57,0,0,0,186,2,0,0,0,65,185,2,0,0,0,106,0,104,148,0,0,0,106,2,106,24,80,232,185,2,0,0,72,131,236,8,72,141,5,190,162,66,0,72,141,61,107,162,66,0,72,141,13,128,162,66,0,190,11,0,0,0],"offset":96}},"threadState":{"r13":{"value":18},"rax":{"value":8589934595},"rflags":{"value":66118},"cpu":{"value":4},"r14":{"value":105553127066368},"rsi":{"value":105553141801216},"r8":{"value":8448},"cr2":{"value":123145434029824},"rdx":{"value":3},"r10":{"value":2043},"r9":{"value":128},"r15":{"value":11},"rbx":{"value":4506453744},"trap":{"value":6},"err":{"value":0},"r11":{"value":127},"rip":{"value":140734008667525,"matchesCrashFrame":1},"rbp":{"value":140701853574640},"rsp":{"value":140701853574560},"r12":{"value":109},"rcx":{"value":18446744065119617024},"flavor":"x86_THREAD_STATE","rdi":{"value":105553127066376}},"queue":"com.apple.main-thread","frames":[{"imageOffset":191877,"symbol":"assertionFailure(:_:file:line:flags:)","symbolLocation":421,"imageIndex":0},{"imageOffset":3951185,"symbol":"AuthCategory.plugin.getter","symbolLocation":2337,"imageIndex":1},{"imageOffset":3945796,"symbol":"AuthCategory.getCurrentUser()","symbolLocation":116,"imageIndex":1},{"imageOffset":944567,"sourceLine":27,"sourceFile":"AuthSessionManager.swift","symbol":"AuthSessionManager.getCurrentAuthUser()","imageIndex":1,"symbolLocation":215},{"imageOffset":2599036,"sourceLine":25,"sourceFile":"KalistenApp.swift","symbol":"KalistenApp.init()","imageIndex":1,"symbolLocation":236},{"imageOffset":2603473,"sourceFile":"","symbol":"protocol witness for App.init() in conformance KalistenApp","symbolLocation":17,"imageIndex":1},{"imageOffset":4426834,"symbol":"static App.main()","symbolLocation":47,"imageIndex":2},{"imageOffset":2603342,"sourceLine":14,"sourceFile":"KalistenApp.swift","symbol":"static KalistenApp.$main()","imageIndex":1,"symbolLocation":30},{"imageOffset":2603513,"sourceFile":"KalistenApp.swift","symbol":"main","symbolLocation":9,"imageIndex":1},{"imageOffset":7969,"symbol":"start_sim","symbolLocation":10,"imageIndex":3},{"imageOffset":21790,"symbol":"start","symbolLocation":462,"imageIndex":4}]},{"id":17514586,"queue":"APMAnalyticsQueue","frames":[{"imageOffset":2113474,"symbol":"nw_resolver_get_next_log_id","symbolLocation":34,"imageIndex":5},{"imageOffset":2111232,"symbol":"-[NWConcrete_nw_resolver initWithEndpoint:parameters:path:log_str:]","symbolLocation":1792,"imageIndex":5},{"imageOffset":2115507,"symbol":"nw_resolver_create_with_path","symbolLocation":115,"imageIndex":5},{"imageOffset":164531,"symbol":"SCNetworkReachabilityRestartResolver","symbolLocation":111,"imageIndex":6},{"imageOffset":160558,"symbol":"SCNetworkReachabilitySetDispatchQueue","symbolLocation":956,"imageIndex":6},{"imageOffset":159240,"symbol":"SCNetworkReachabilityScheduleWithRunLoop","symbolLocation":510,"imageIndex":6},{"imageOffset":7528642,"symbol":"-[GULReachabilityChecker start]","symbolLocation":322,"imageIndex":1},{"imageOffset":7536023,"symbol":"-[GULNetwork initWithReachabilityHost:]","symbolLocation":231,"imageIndex":1},{"imageOffset":10679728,"symbol":"-[APMETaskManager init]","symbolLocation":175,"imageIndex":1},{"imageOffset":10657912,"symbol":"-[APMEManager init]","symbolLocation":45,"imageIndex":1},{"imageOffset":10657552,"symbol":"29+[APMEManager sharedInstance]_block_invoke","symbolLocation":37,"imageIndex":1},{"imageOffset":11045,"symbol":"_dispatch_client_callout","symbolLocation":8,"imageIndex":7},{"imageOffset":15581,"symbol":"_dispatch_once_callout","symbolLocation":20,"imageIndex":7},{"imageOffset":10657513,"symbol":"+[APMEManager sharedInstance]","symbolLocation":46,"imageIndex":1},{"imageOffset":10779634,"symbol":"+[APMMeasurement initializeSharedInstanceWithAppID:isAnalyticsCollectionEnabled:isAnalyticsCollectionDeactivated:safelistedEvents:]","symbolLocation":168,"imageIndex":1},{"imageOffset":10497579,"symbol":"46+[APMAnalytics startWithAppID:origin:options:]_block_invoke_2","symbolLocation":56,"imageIndex":1},{"imageOffset":6372,"symbol":"_dispatch_call_block_and_release","symbolLocation":12,"imageIndex":7},{"imageOffset":11045,"symbol":"_dispatch_client_callout","symbolLocation":8,"imageIndex":7},{"imageOffset":37087,"symbol":"_dispatch_lane_serial_drain","symbolLocation":753,"imageIndex":7},{"imageOffset":40129,"symbol":"_dispatch_lane_invoke","symbolLocation":400,"imageIndex":7},{"imageOffset":84347,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":779,"imageIndex":7},{"imageOffset":12240,"symbol":"_pthread_wqthread","symbolLocation":326,"imageIndex":8},{"imageOffset":8023,"symbol":"start_wqthread","symbolLocation":15,"imageIndex":8}]},{"id":17514587,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":8}]},{"id":17514588,"queue":"com.firebase.FIRInstallationsStore","frames":[{"imageOffset":6522,"symbol":"mach_msg_trap","symbolLocation":10,"imageIndex":9},{"imageOffset":7400,"symbol":"mach_msg","symbolLocation":56,"imageIndex":9},{"imageOffset":112044,"symbol":"_dispatch_mach_send_and_wait_for_reply","symbolLocation":567,"imageIndex":7},{"imageOffset":113047,"symbol":"dispatch_mach_send_with_result_and_wait_for_reply","symbolLocation":55,"imageIndex":7},{"imageOffset":43956,"symbol":"xpc_connection_send_message_with_reply_sync","symbolLocation":219,"imageIndex":10},{"imageOffset":1300063,"symbol":"104-[CFPrefsSearchListSource synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:]_block_invoke_2","symbolLocation":28,"imageIndex":11},{"imageOffset":1559717,"symbol":"-[_CFXPreferences withConnectionForRole:performBlock:]","symbolLocation":33,"imageIndex":11},{"imageOffset":1300008,"symbol":"104-[CFPrefsSearchListSource synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:]_block_invoke","symbolLocation":105,"imageIndex":11},{"imageOffset":1299696,"symbol":"CFPREFERENCES_IS_WAITING_FOR_SYSTEM_CFPREFSD","symbolLocation":74,"imageIndex":11},{"imageOffset":1290143,"symbol":"-[CFPrefsSearchListSource synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:]","symbolLocation":263,"imageIndex":11},{"imageOffset":1300525,"symbol":"-[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:]","symbolLocation":198,"imageIndex":11},{"imageOffset":1294390,"symbol":"-[CFPrefsSearchListSource alreadylocked_getDictionary:]","symbolLocation":375,"imageIndex":11},{"imageOffset":1293258,"symbol":"-[CFPrefsSearchListSource alreadylocked_copyValueForKey:]","symbolLocation":150,"imageIndex":11},{"imageOffset":898667,"symbol":"-[CFPrefsSource copyValueForKey:]","symbolLocation":47,"imageIndex":11},{"imageOffset":1571277,"symbol":"76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke","symbolLocation":32,"imageIndex":11},{"imageOffset":1307119,"symbol":"108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke","symbolLocation":395,"imageIndex":11},{"imageOffset":1304814,"symbol":"normalizeQuintuplet","symbolLocation":322,"imageIndex":11},{"imageOffset":1306696,"symbol":"-[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:]","symbolLocation":121,"imageIndex":11},{"imageOffset":1570995,"symbol":"-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]","symbolLocation":137,"imageIndex":11},{"imageOffset":1581818,"symbol":"_CFPreferencesCopyAppValueWithContainerAndConfiguration","symbolLocation":101,"imageIndex":11},{"imageOffset":7410701,"symbol":"-[GULUserDefaults objectForKey:]","symbolLocation":349,"imageIndex":1},{"imageOffset":7491730,"symbol":"60-[FIRInstallationsStore installationExistsForAppID:appName:]_block_invoke","symbolLocation":98,"imageIndex":1},{"imageOffset":7143846,"symbol":"38+[FBLPromise(DoAdditions) onQueue:do:]_block_invoke","symbolLocation":54,"imageIndex":1},{"imageOffset":6372,"symbol":"_dispatch_call_block_and_release","symbolLocation":12,"imageIndex":7},{"imageOffset":11045,"symbol":"_dispatch_client_callout","symbolLocation":8,"imageIndex":7},{"imageOffset":37379,"symbol":"_dispatch_lane_serial_drain","symbolLocation":1045,"imageIndex":7},{"imageOffset":40129,"symbol":"_dispatch_lane_invoke","symbolLocation":400,"imageIndex":7},{"imageOffset":84347,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":779,"imageIndex":7},{"imageOffset":12240,"symbol":"_pthread_wqthread","symbolLocation":326,"imageIndex":8},{"imageOffset":8023,"symbol":"start_wqthread","symbolLocation":15,"imageIndex":8}]},{"id":17514589,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":8}]},{"id":17514590,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":8}]}], "usedImages" : [ { "source" : "P", "arch" : "x86_64", "base" : 140734008475648, "size" : 4747264, "uuid" : "b0a029ef-6df2-346b-8248-6570a2137e92", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/swift\/libswiftCore.dylib", "name" : "libswiftCore.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 4495208448, "CFBundleShortVersionString" : "1.03", "CFBundleIdentifier" : "vilhon.Kalisten", "size" : 12468224, "uuid" : "c3c37920-d04f-3170-9314-6c1317292a41", "path" : "\/Users\/USER\/Library\/Developer\/Xcode\/UserData\/Previews\/Simulator Devices\/74D1B278-0DF5-4A83-AB10-35363A4E4ED3\/data\/Containers\/Bundle\/Application\/FC5DFDC3-367B-45DE-A0F9-9D869287AA82\/Kalisten.app\/Kalisten", "name" : "Kalisten", "CFBundleVersion" : "1" }, { "source" : "P", "arch" : "x86_64", "base" : 140734752980992, "CFBundleShortVersionString" : "3.4.12", "CFBundleIdentifier" : "com.apple.SwiftUI", "size" : 15269888, "uuid" : "1f4075a1-4d0c-3c72-a76a-91300689360e", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/System\/Library\/Frameworks\/SwiftUI.framework\/SwiftUI", "name" : "SwiftUI", "CFBundleVersion" : "3.4.12" }, { "source" : "P", "arch" : "x86_64", "base" : 4547735552, "size" : 319488, "uuid" : "d5f18ce9-9569-30ea-86b1-355b990260dd", "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" }, { "source" : "P", "arch" : "x86_64", "base" : 4768673792, "size" : 442368, "uuid" : "dd9e80de-fb3b-349b-96a4-46874ad34d11", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "source" : "P", "arch" : "x86_64", "base" : 140733771644928, "size" : 9310208, "uuid" : "153ece42-6d68-369f-8a04-6909f9e30059", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/libnetwork.dylib", "name" : "libnetwork.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140733737160704, "CFBundleShortVersionString" : "1.21", "CFBundleIdentifier" : "com.apple.SystemConfiguration", "size" : 454656, "uuid" : "404b9836-0b78-33b0-814f-2801093279c7", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/System\/Library\/Frameworks\/SystemConfiguration.framework\/SystemConfiguration", "name" : "SystemConfiguration", "CFBundleVersion" : "1.21" }, { "source" : "P", "arch" : "x86_64", "base" : 140733731385344, "size" : 290816, "uuid" : "2020b811-1706-3efe-8226-a9906bb69f52", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/system\/libdispatch.dylib", "name" : "libdispatch.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140735067205632, "size" : 49152, "uuid" : "2f6c275d-7e14-3d31-a924-e1bb41d2415f", "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", "name" : "libsystem_pthread.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140735066836992, "size" : 229376, "uuid" : "26a59789-b846-3ed4-96dc-8dbef3c0c8e7", "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", "name" : "libsystem_kernel.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140733730615296, "size" : 212992, "uuid" : "3766ec43-ad39-3003-87ce-c54d4f64d800", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/system\/libxpc.dylib", "name" : "libxpc.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140733733343232, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.CoreFoundation", "size" : 3817472, "uuid" : "6cd8003f-fe68-3e98-8a29-cc834000fffd", "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", "name" : "CoreFoundation", "CFBundleVersion" : "1858.112" } ], "sharedCache" : { "base" : 140733730258944, "size" : 3275014144, "uuid" : "a2e42725-d117-33cc-85ec-1007e7b8389f" }, "vmSummary" : "ReadOnly portion of Libraries: Total=1.0G resident=0K(0%) swapped_out_or_unallocated=1.0G(100%)\nWritable regions: Total=586.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=586.4M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 8K 1 \nMALLOC 191.4M 26 \nMALLOC guard page 16K 3 \nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.0M 6 \nStack 10.5M 6 \nVM_ALLOCATE 8K 2 \nDATA 23.0M 518 \n__DATA_CONST 42.1M 508 \nDATA_DIRTY 22K 10 \nFONT_DATA 4K 1 \nLINKEDIT 562.4M 14 \nLLVM_COV 624K 1 \nOBJC_RO 63.0M 1 \n__OBJC_RW 3168K 1 \nTEXT 495.0M 523 \nUNICODE 592K 1 \ndyld private memory 2048K 2 \nmapped file 29.0M 2 \nshared memory 16K 1 \n=========== ======= ======= \nTOTAL 1.8G 1629 \nTOTAL, minus reserved VM space 1.4G 1629 \n", "legacyInfo" : { "threadTriggered" : { "queue" : "com.apple.main-thread" } }, "trialInfo" : { "rollouts" : [ { "rolloutId" : "61af99aeda72d16a4beb7756", "factorPackIds" : { "SIRI_DIALOG_ASSETS" : "62702db852dd330db9df17d1" }, "deploymentId" : 240000156 }, { "rolloutId" : "5ffde50ce2aacd000d47a95f", "factorPackIds" : {

  },
  "deploymentId" : 240000145
}

], "experiments" : [

] } }

Model: MacBookPro16,1, BootROM 1731.100.130.0.0 (iBridge: 19.16.14243.0.0,0), 8 processors, 8-Core Intel Core i9, 2,3 GHz, 16 GB, SMC Graphics: Intel UHD Graphics 630, Intel UHD Graphics 630, Built-In Graphics: AMD Radeon Pro 5500M, AMD Radeon Pro 5500M, PCIe, 4 GB Display: Color LCD, 3072 x 1920 Retina, MirrorOff, Online Display: DELL U2715H, 2560 x 1440 (QHD/WQHD - Wide Quad High Definition), Main, MirrorOff, Online Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2667 MHz, Micron, 8ATF1G64HZ-2G6E1 Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2667 MHz, Micron, 8ATF1G64HZ-2G6E1 AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x7BF), wl0: Jul 12 2021 18:02:56 version 9.30.464.0.32.5.76 FWID 01-c081cfed Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Spaces LAN, Ethernet, en7 Network Service: Wi-Fi, AirPort, en0 USB Device: USB3.0 Hub USB Device: USB3.0 Card Reader USB Device: AX88179A USB Device: USB31Bus USB Device: USB2.0 Hub USB Device: Keyboard Hub USB Device: Apple Keyboard USB Device: Apple Watch Magnetic Charging Cable USB Device: USB 2.0 BILLBOARD USB Device: T2Bus USB Device: composite_device USB Device: Touch Bar Backlight USB Device: Touch Bar Display USB Device: Apple Internal Keyboard / Trackpad USB Device: Headset USB Device: Ambient Light Sensor USB Device: FaceTime HD Camera (Built-in) USB Device: Apple T2 Controller Thunderbolt Bus: MacBook Pro, Apple Inc., 63.5 Thunderbolt Bus: MacBook Pro, Apple Inc., 63.5`

harsh62 commented 2 years ago

@Pedrosolisg From the logs, I see that you are using getCurrentUser in App.main(). This change that was done only applies to Amplify.configure(). We don't yet support other API's on SwiftUI Previews. If you would like to have this feature implemented in other API's, kindly create another ticket and our team will triage and prioritize it.