Crash when running on device after second launch
I encountered the same crash issue and then I resolved it. I would like you to share the following my solution, but it might depend on your app. I hope it would help you.
In this thread in Apple's forum, eskimo's comment saved me(By the way, eskimo always helps me in the forum). According to the comment, I knew I had to check console logs of my device in Console app and then I found the following log.
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView because no class named MKMapView was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)'
Thanks to the log's instruction, I figured out there was a problem to link Maps.framework with my app binary. So I put Maps.framework into "Frameworks, Libraries, and Embedded Content" in Xcode.
As a result, I could resolved the crash issue!(That's weird.) I think this issue should be owned by Xcode 11 and it needs to be fixed by Xcode.
App crashing on second launch only after upgrading from iOS8 to iOS 9.2
It appears to be stemming from a known bug in 9.2 related to SpriteKit particle emitters. Removing the node or lowering the birthrate has stopped the crashing.
Application runs one time but crashes the second time
Your problem may be in not properly releasing your map delegate. I assume that since you create your MKMapView in viewDidLoad, you release it in the viewDidUnload, which most likely gets called when you fast switch the app. If you have set delegate for the MKMapView you created, you have to set the map view's delegate = nil before you release the MKMapView.
Related Topics
Does Nsnumberformatter.Stringfromnumber Ever Return Nil
How Have Multiple Init() with Swift
Implementing Stringliteralconvertible on Nsurl
Swift: Label Text --> "Fatal Error: Unexpectedly Found Nil While Unwrapping an Optional Value"
How to Check If a Type Is Optional in Swift
How to Convert a Unsafemutablepointer<Void> to Uint8
Why Is Casting a Struct to Anyobject Not a Compile Error in Swift
Cannot Call Value of Non-Function Type 'Nshttpurlresponse' Alamofire Objectmapper
Self' Is Only Available in a Protocol or as the Result of a Class Method
How to Convert Unmanaged<Cfdata> to Nsdata
How to Create a Directory in Downloads Folder with Swift on MACos? Permission Exception
Check If Color Is Blue(Ish), Red(Ish), Green(Ish),
Generate Random Number of Certain Amount of Digits
How to Remove Space Above and Below Text View in Swiftui
Lottieanimationview Size Won't Change/Is Too Small (Ios/Swift)
Stack Overflow When Defining Subscript on Ckrecord in Swift
How to Replicate Hash_Hmac('Sha256', $Key, $Secret_Key) Function in Swift 4