Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async/await when running on pre iOS 13 devices #526

Closed
gabors opened this issue Dec 28, 2021 · 11 comments
Closed

Async/await when running on pre iOS 13 devices #526

gabors opened this issue Dec 28, 2021 · 11 comments

Comments

@gabors
Copy link

gabors commented Dec 28, 2021

Hi @kean

I'm not sure this is going to be an issue, but I just ran into a problem with a different framework on iOS 12
Alamofire/Alamofire#3529

The app would crash on iOS 12 and earlier because of libswift_Concurrency.dylib even though it's not being used.

Just wanted to bring this up in case we may run into similar problem with Nuke 10.6.
I don't have the ability to test this on a pre iOS 13 device using an AppStoreConnect build as TestFlight is not supported anymore pre 13.

@kean
Copy link
Owner

kean commented Dec 28, 2021

Oh, wow. Yeah, thanks for bringing this up. If that's the case, I think it would be best to revert the changes for now. I'm not sure I can afford to jump from iOS 11 to iOS 13 as a minimum required version just yet.

@gabors
Copy link
Author

gabors commented Dec 28, 2021

Yeah we are going the same conundrum now. :)

Xcode 13.2 release notes has a suggested workaround here
https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes

Known Issues
Apps built with Xcode 13 or Xcode 13.1 that make use of Swift Concurrency features (such as async/await), deploy to iOS prior to 15, tvOS prior to 15, or watchOS prior to 8, and have bitcode enabled may crash at launch with an error reporting that the libswift_Concurrency.dylib library was not loaded. (86349088)
Workaround: Add -Wl,-weak-lswift_Concurrency -Wl,-rpath,/usr/lib/swift to Other Linker Flags in the app’s build settings.

But since it is impossible to test this for me without pushing an app to the AppStore I'm hesitant on using it.

@kean
Copy link
Owner

kean commented Dec 28, 2021

I deleted the release for now until there is more information. If someone's interested in using async/await, please install Nuke from the branch.

@gabors
Copy link
Author

gabors commented Dec 28, 2021

Cool, thanks. Probably for the best for the time being.
For projects with iOS/tvOS 13 min version this likely won't be a problem.
С Новым Годом ;)

@kean
Copy link
Owner

kean commented Dec 28, 2021

С Наступающим!

@kean kean mentioned this issue Jan 24, 2022
@mohpor
Copy link

mohpor commented Apr 23, 2022

Alamofire did resolve this. It can be done. Very intereted to use it with async/await.

Check this out:
Alamofire/Alamofire#3529 (comment)

P.S.: why not have it as an extension module for now until we are sure it won't break anything? Those who are iOS 13.0+ can use it at least!

@kean
Copy link
Owner

kean commented Apr 24, 2022

Thanks, @mohpor. This is fantastic news! I'll release async/await this weekend.

@gabors
Copy link
Author

gabors commented Apr 24, 2022

@mohpor @kean
Alamofire did not really change anything to resolve this issue.
They simply made the async/await code require Swift 5.6 and Xcode 13.3 happens to resolve the AppStore connect issue.

@kean
Copy link
Owner

kean commented Apr 24, 2022

Yes, I did the same. My understanding is that it addresses the issue with iOS 12 and earlier devices.

// Before:
#if swift(>=5.5.2))

// After
#if swift(>=5.6)
@mohpor
Copy link

mohpor commented Apr 24, 2022

@gabors Yes. I know. But, there was a fix in Xcode 13.3.1 that made it possible.

Fixed: Exporting an app that uses Swift’s concurrency features from an archive with bitcode might fail when the app targets iOS 13.0–14.7, watchOS 6.0–7.6, or tvOS 13.0–14.7. (89271047)

I hope this will resolve some of the issues.

@kean
Copy link
Owner

kean commented Apr 24, 2022

Async/Await available in version 10.8. I tested it on iOS 12 simulator – doesn't crash.

@kean kean closed this as completed Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants