App crashes at start under iOS 13.x, runs fine with iOS 14

Hi everyone ;-)

Weird behavior here. I develop an app that works fine under iOS 14.x (any subversion). It's a classic storyboard/swift app.

It is supposed to be compatible with iOS 13.x devices but when I launch it, I get a crash right away, no crash log, no report, and not in a method or class that I developed :-/

It seems that I tries to load a SwiftUI object (State object) and doesn't find it, which is pretty logical. Th thing is : I don't use SwiftUI in my code (besides maybe the SceneDelegate ? )

Here is the only data I can gather

Code Block
dyld: Symbol not found: _$s7SwiftUI11StateObjectVMn
Referenced from: /Users/gg/Library/Developer/CoreSimulator/Devices/9EADF5C5-D5E6-46F8-8A99-98801D5F67FD/data/Containers/Bundle/Application/C9272BF0-688C-4DA4-8799-B9E335155905/taxi.Chauffeur.app/taxi.Chauffeur
Expected in: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
in /Users/gg/Library/Developer/CoreSimulator/Devices/9EADF5C5-D5E6-46F8-8A99-98801D5F67FD/data/Containers/Bundle/Application/C9272BF0-688C-4DA4-8799-B9E335155905/taxi.Chauffeur.app/taxi.Chauffeur
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/gg/Library/Developer/CoreSimulator/Caches/dyld/20D91/com.apple.CoreSimulator.SimRuntime.iOS-13-7.17H22
DYLD_ROOT_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.7.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/gg/Library/Developer/Xcode/DerivedData/taxi.Chauffeur-ceaclbvdpopdwqdodbmzcecwohzz/Build/Products/Debug-iphonesimulator:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.7.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.7.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.7.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.7.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framewor


Any help would be most appreciated.
Thanks.
Answered by radada in 667102022
Found it : I had an SPM package that used StateObject.
However, this package requires iOS14 minimum and my project targeted iOS 13.4, weird :-/
Anyway, thanks for your help ;-)
What are the targets defined for the app ? 13 or 14 ?
Does the crash occur on device, on simulator, on both ?

I don't use SwiftUI in my code (besides maybe the SceneDelegate ?

No, SceneDelegate has no link in itself to SwiftUI.
When you defined the app, did you define as UIKit lifecycle ?

Did you try an option-clean build folder ?

Have you a file named chauffeur (either chauffeur.swift or chauffeur.xib) ? If so, please post code.
Hi and thanks for your answer,

yes the targets are 13.4 min and it occurs on both device and simulator.
it happens right away, while splash screen is still visible and I don't have any chauffeur.swift or .xib.
It is UIKit lifecycle, nothing special. And yes, first thing I try to hard clean the project ;-)

App crashes at start under iOS 13.x

what x ?
Does it work in 13.5 ?
Does it crash below 13.4 ?
iOS 14.x (any subversion), same for 13. I can't go below 13.4 because I use some methods that are available only starting with 13.4
So basically, any 13 version crashes, all 14 versions work...
Accepted Answer
Found it : I had an SPM package that used StateObject.
However, this package requires iOS14 minimum and my project targeted iOS 13.4, weird :-/
Anyway, thanks for your help ;-)
App crashes at start under iOS 13.x, runs fine with iOS 14
 
 
Q