SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 742 forks source link

Crash on loading MessageView #409

Closed jerometonnelier closed 3 years ago

jerometonnelier commented 3 years ago

Hi everyone,

I usually use SwiftMessages with cocoa pods and it's awesome. But I use SPM in my project, and I get a crash when I load a simple MessageView like this :

let view = MessageView.viewFromNib(layout: .messageView)

Here is the stack :

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/gg/Library/Developer/CoreSimulator/Devices/786E0724-3032-45E3-B798-DDA118A3C7D9/data/Containers/Bundle/Application/8F59BABE-DC19-4BCC-8F37-9698537A01EB/Chef oui Chef!.app> (loaded)' with name 'MessageView'' *** First throw call stack: ( 0 CoreFoundation 0x00007fff23e3de6e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff512539b2 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23e3dcac +[NSException raise:format:] + 188 3 UIKitCore 0x00007fff48f7c153 -[UINib instantiateWithOwner:options:] + 491 4 UIKitCore 0x00007fff48f7d117 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 147 5 Chef oui Chef! 0x0000000109611eba $s13SwiftMessagesAAC19internalViewFromNib33_AB28F0CA9BFF0B16E059C4C20EF9AFAALL5named6bundle10filesOwnerxSS_So8NSBundleCSgyXltKSo6UIViewCRbzlFZ + 1130 6 Chef oui Chef! 0x000000010961231b $s13SwiftMessagesAAC11viewFromNib5named10filesOwnerxSS_yXltKSo6UIViewCRbzlFZ + 91 7 Chef oui Chef! 0x00000001095e3ff3 $s13SwiftMessages11MessageViewC11viewFromNib6layout10filesOwnerxAC6LayoutO_yXltACRbzlFZ + 163 8 Chef oui Chef! 0x0000000108dd46a0 $s13SwiftMessagesAAC09Chef_oui_C1_E4show33_268538DF33708733533841CDFFE1BA52LL4from2in8duration15interactiveHide5title7message15backgroundColor0N4Font04bodyR004textQ011buttonTitle0u4TextQ00uR013eventListener7vibrate0U10TapHandleryAB17PresentationStyleO_So6UIViewCSgAB8DurationOSbS2SSgSo7UIColorCSo6UIFontCA5_A3_A1_A3_SgA5_SgSayyAB5EventOcGSgSbySo8UIButtonCcSgtFZ + 1264

Any help would be appreciated. Thanks

wtmoose commented 3 years ago

https://github.com/SwiftKickMobile/SwiftMessages/pull/395

jerometonnelier commented 3 years ago

My bad, I though you supported fully the SPM now. Thanks for your help ;-)

wtmoose commented 3 years ago

If you're using Xcode 12, you can run the pre-release work/xcode12 branch, in which SPM does fully support SwiftMessages.

jerometonnelier commented 3 years ago

Thanks, but I'm still using Xcode 11. I have an issue though : when I try to archive the project, the build phase fails because the checkout folder is replaced with a release-iPhone folder in the SourcePackage :-/ Do you have any script that works for both dev and release? (sorry I never managed to master the build script :D) Thanks.

wtmoose commented 3 years ago

Try the script I left in a comment on #395

jerometonnelier commented 3 years ago

Worked like a charm ;-) Thanks again for your help, much appreciated ^_^

jerometonnelier commented 3 years ago

I'm sorry to bother you again @wtmoose but I installed XCode12 yesterday, used the work/xcode12 branch, and it crashes when trying to load a MessageView. Any clue? I guess I might be doing something wrong again. Thanks ;-)