-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Set iOS deployment target to 8.0, fixes compilation errors #780
Set iOS deployment target to 8.0, fixes compilation errors #780
Conversation
|
Just a curiosity question: Why is the deployment target being set so low? iOS 6.0 is very, very old and the user base right now is very low ( https://data.apteligent.com/ios/ ). However, my major concern right now is that using such a low deployment target may prevent us from adopting modern APIs and development practices. Apple deprecates so many APIs between major releases that we may also be at risk of using something they are no longer allowing to be used in apps. |
|
Short answer: I used what is already set in cloud_firestore plugin. Long answer: I’m not too familiar with how pods resolve this thing. :) It looks like without it xcode thinks it supports 5.0 and fails to compile. Note that per Firebase dev answer here https://stackoverflow.com/questions/31076786/error-while-compiling-firebase-based-project-in-objective-c 6.0 is the lowest supported by the sdks. When I run pod update it prints in the end something like “setting deployment target to 8.0”, do this setting probably works more like minimum supported target? I’m just thinking out loud though and someone with more experience should weigh in. Nevertheless this fixes the issue at least. |
|
From this page in official docs: https://guides.cocoapods.org/syntax/podspec.html#deployment_target
So I guess it does work as |
|
Hi @pulyaevskiy, Thank you for your notes. I hope someone else can chime in too. From my personal experience (iOS dev since 2009, former iOS instructor, Cocoapods user since 2013), In other words, only allow compilation for APIs that are available on all iOS SDK versions from 5.0 up through 12.0. This excludes all APIs that were introduced after iOS 5.0, as well as all APIs that were deprecated since iOS 5.0 was initially released. When I was looking at the Unless there is a bug, Cocoapods should print out
This may be of some help as well: CocoaPods/CocoaPods#7314 (comment) One last comment, Apple sent shockwaves through the iOS community when they released iOS7 and then again when they released Swift with iOS8. iOS7 ushered in the modern iOS UI, and Swift greatly changed the development workflow for iOS (some may say the dust still hasn't settled from either yet.) Thanks, |
|
Thanks for thorough explanation! This is really helpful. As a side note, It'd be ok with me to change it to as high a number as makes sense to people more experienced in iOS development. But, I also think that changing it in just one Firebase plugin of many won't make a big difference. To address the "deployment target" issue we should probably update all of them at once. I created this PR to address a different blocking issue - adding That said, I do see value in your suggestions, however my expertise is simply not enough to tackle such a project. I can only encourage you submit a separate PR with updates to deployment targets across all Firebase plugins. This would at least facilitate discussion with the Flutter team and help to resolve it sooner. |
|
Also a friendly ping to @kroikie for a chance to get this reviewed. :) |
|
Thanks @pulyaevskiy . Sounds like a good plan. |
|
Flutter only supports iOS 8.0 and above so there would be no point in setting the deployment target to anything below 8.0: https://flutter.io/ios-release/#review-xcode-project-settings |
|
@pulyaevskiy, CocoaPods together with a line of code in Swift anywhere (in your app or in a dependency) will mechanically require framework support (or the newer CocoaPods 1.5.x with Swift static lib support) and iOS 8+ support. So in order to have the older targets iOS 7 (or iOS 6) supported, one prerequisite would be to have a pure Objective-C app (including all your pods). That's not a popular audience; it's better to encourage Swift+CocoaPods compatibility and have everybody say goodbye to iOS 7 or older. The next big upcoming goodbye will be 32 bits apps (both on iOS and macOS). |
…mum supported by Flutter itself
Makes sense. I pushed an update which bumps it to |
|
Just pushed a fix for null pointer error when callable function fails with exception. This was causing my app to crash. Also friendly reminder for @kroikie . Would be nice to get this merged and remove dependency override finally. :) |
|
I've stumbled onto this error too. Could we please get this pull request merged @kroikie? Alternatively, @pulyaevskiy, how could I use this now? Edit: Never mind @pulyaevskiy, I've worked it out. For others that may stumble into the same issue, I've forked the plugins and applied the fix from this pull request in it. You should be able to modify your To do so, add the following to your Edit: I have updated my forked repo to match the changes that @kroikie has made to master while still keeping the fixes described in this pull request. Good luck! |
|
Just pushed an update to resolve conflicts with master. Anything else I can help with to get this in? @kroikie |
|
dispatch_queue_t callbackQueue; This error is still present: flutter/flutter#21363 |
Does using my above recommendation fix that for you? |
|
Yes if I manually go to cloud functions / firestore plugin podspec and change deployment target to 8.0 and reinstall pods it works. ie. I still dont understand why this is not by default set to at least 8.0 |
|
@radvansky-tomas Right, gotcha. Yeah, as you'll see in the conversation about, this pull request sets the deployment target to 8.0, so once this pull request is accepted, it shouldn't be a problem. |
kroikie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for resolving this!
|
Awesome! Thanks for merging this. |
* Set iOS deployment target to 6.0, fixes compilation errors * Fix null pointer error when callable fails with exception
…lutter#780)" This reverts commit 27b70df.
* Set iOS deployment target to 6.0, fixes compilation errors * Fix null pointer error when callable fails with exception
Fixes flutter/flutter#21363.