sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.85k stars 365 forks source link

Breaks apps on iOS 12 #220

Open ultimate-deej opened 4 years ago

ultimate-deej commented 4 years ago

The library seems to prevent apps from running on iOS 12 (and possibly below) except when being run via Xcode. Nether TestFlight nor Ad-Hoc build works when installed to a iOS 12 device. However, the same build works on a iOS 13 device. I tested this with a newly created blank project only adding SwiftyUserDefaults via CocoaPods. Removing the pod makes the app work again.

sunshinejr commented 4 years ago

@ultimate-deej so you are able to run the app on iOS 12 but only when built with Xcode? Also what does it mean that it doesn't work - do you have an error message maybe?

ultimate-deej commented 4 years ago

Yes it only works when built and run with Xcode. It just doesn't start, closing as soon as it opens. No errors or anything.

sunshinejr commented 4 years ago

@ultimate-deej So the TestFlight or Ad-Hoc builds are built by a CI? I'm trying to figure out how to quickly reproduce the issue. Can you give me your environment details? (e.g. macOS version, Xcode version)

ultimate-deej commented 4 years ago

I didn't use a CI. The first couple of builds were built with fastlane, then I switched to manual export from Xcode Organizer. My environment is macOS 10.14.6, Xcode 11.0, CocoaPods 1.8.0. The library versions I tried were 5.0.0-beta.2 and 5.0.0-beta.4.

sunshinejr commented 4 years ago

@ultimate-deej I was able to confirm that archiving with CocoaPods indeed links it strongly, not weakly. Still investigating the issue.

nthtrung09it commented 4 years ago

App crashes when running on iOS 12.4.1. Here is device log:


Frameworks/SwiftyUserDefaults.framework/SwiftyUserDefaults | Reason: image not found
Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                            0x000000010126a418 __abort_with_payload + 8
1   dyld                            0x0000000101269a58 abort_with_payload_wrapper_internal + 100
2   dyld                            0x0000000101269a88 fcntl + 0
3   dyld                            0x000000010122c8f8 dyld::fastBindLazySymbol+ 18680 (ImageLoader**, unsigned long) + 0
4   dyld                            0x000000010122f6e4 dyld::_main+ 30436 (macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 5396
5   dyld                            0x0000000101229044 _dyld_start + 68

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x000000016ef8a990   x3: 0x00000000000000e3
    x4: 0x000000016ef8a590   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000390
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x74666977532f6b72  x11: 0x6665447265735579
   x12: 0x20200a73746c7561  x13: 0x203a6e6f73616552  x14: 0x6f6e206567616d69  x15: 0x00646e756f662074
   x16: 0x0000000000000209  x17: 0x0000000000000010  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016ef8a590  x21: 0x00000000000000e3  x22: 0x000000016ef8a990  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x000000000000002f  x26: 0x00000001012835e0  x27: 0x0000000101283000
   x28: 0x0000000101283a00   fp: 0x000000016ef8a560   lr: 0x0000000101269a58
    sp: 0x000000016ef8a520   pc: 0x000000010126a418 cpsr: 0x00000000
thihaaung6245 commented 4 years ago

Same here, crashed as well. Make build on apple enterprise account with CI. iOS 13 working fine. Just having crash on 12.4.1. I am using 5.0.0-beta.4 by the way.

sunshinejr commented 4 years ago

@nthtrung09it @thihaaung6245 it seems like there might be a problem with Combine framework itself. We have the same problem in Moya (also Kingfisher). You can take a look at this mega-thread for more details, but I will be removing the Combine support because of that in both Moya and Swifty and maybe reintroduce it later on. Sorry for the problem.

thihaaung6245 commented 4 years ago

Thanks @sunshinejr , just let you know. Happy to help.

sunshinejr commented 4 years ago

@thihaaung6245 yeah exactly that's the problem. In the thread I described what we can do to avoid it, but it's really not that easy and we would break compatibility by doing so. Unfortunately it seems like if you want to use a framework that uses Combine and your min. target is lower than 13, then it's a big risk.

thihaaung6245 commented 4 years ago

@sunshinejr Yeah, looks like need to downgrade for a while. Appreciate the support. Cheers.

sunshinejr commented 4 years ago

@thihaaung6245 yup good idea. New beta version without Combine should be up soon, in the meantime use 4.* or just don't make release builds and you can use 5 betas.