What changes need to make after changing deployment target in iOS app - ios

I am working on an iOS project. This project has been implemented in Swift with some pods (Frameworks) included in the project.
Recently a requirement has come to change Deployment Target from iOS 8.0 to 9.0, I changed it and built the app. The app works fine without any error. But this project has Podfile with below line,
platform :ios, '8.0'
I am confused whether to change this as well or not.
Other than this please mention any other changes required in the project after changing deployment target?

Yes, you should change the podfile as well, so that the code in the library also gets compiled with iOS 9 as its deployment target.

Related

KMM - How to set iOS deployment target?

I am trying to initialize a KMM project. On the initialization page it asks for minSdk version for Android but not for iOS.
The only way I could find was to traverse the files and manually change iOS deployment target in all of them. I even opened the project in XCode and changed the deployment target in XCode but it did not affect anything either.
Is there any proper workaround or official solution to change iOS deployment target?
No need to manually change XCode project files, you should:
Open iOS project in XCode
Select project file
Go to Build Settings
Search for ios deployment
Change iOS deployment target
Commit changes they will be in iosApp/iosApp.xcodeproj/project.pbxproj if you are using standard KMM template

Flutter Firebase_Admob "The Google Mobile Ads SDK requires a deployment target of iOS 8.0 or later." iOS error

I am consistently getting the "The Google Mobile Ads SDK requires a deployment target of iOS 8.0 or later." error when trying to build my Flutter project in iOS. I've updated the workspace to the Legacy Build System, changed my target to 9.0, updated the podfile, and added the necessary entry on my infoplist. Any ideas on how to fix this error?
The Google-Mobile-Ads podspec did recently update its minimum iOS version in the 7.43.0 release. I'm not sure why it would be a problem if your Podfile includes platform :ios, '8.0'. One workaround might be to go back to Google-Mobile-Ads 7.42.2 with pod 'Google-Mobile-Ads', '7.42.2' to support back to iOS 6.0.
Answer? I may break something doing this, but I simply commented out the "if" statement in the Google Mobile Ads SDK
//#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
//#error The Google Mobile Ads SDK requires a deployment target of iOS 8.0 or later.
//#endif
It works for me now. If anyone knows a more valid way of doing this or if I should never do this please comment on this post.

"No such module" error when archiving

My Swift 4 app rebuilds and runs successfully on all simulators except for Generic iOS Device. If I try to archive it or do a rebuild on Generic iOS Device, I get a No such module error relating to one of my pod frameworks.
I tried adding the framework to Linked Frameworks and Libraries, and that removed the error, but then it fails on the next pod framework, and so on. I have tried all sorts of paths in Framework Search Paths with no luck.
Currently, the value is set to:
I even tried deleting the workspace, the pod lock file, and the pods folder, and then I did a pod install to rebuild everything. Again, it rebuilds clean on any simulator except the generic one. On the generic one, I get No such module on all import statements for pod frameworks.
Any suggestions appreciated, as this problem has me completely stalled, since I can't get a release out.
For me what fixed it was removing one line from my Podfile and rerun pod install.
platform :ios, '11.0'
I think the version of the pods was not aligned with the version of my target, causing this issue.
I was able to fix the problem editing the ios version line in the Podfile to match the Project target version (10.0 in this case) in Info.
#Podfile
platform :ios, '10.0'
Finally I had to run
pod update
After that, I was able to Archive my project selecting Generic iOS Device
In my case I had selected a Device on Xcode when archiving, choosing Generic iOS Device solved my problem.
It's better to check the project settings by going to Build Settings, find Framework Search Paths and add $(SRCROOT) and be sure it's recursive.
I kept facing the issue "No such module" while archiving the app.
I tried this approved answer and it worked perfectly but, a new warning was appearing in my Podifle.
So I did the below and it worked without any warning.
Podfile :
XCode -> Targets -> My App -> General :
switched iOS from 10.0 to 11.0 and then everything worked perfectly.
Seems like by opening up the project by double clicking Runner.xcworkspace instead of Runner.xcodeproj, xcode can finally figure out where everything is. Even though you can still debug in an emulator and on a connected phone from the .xcodeproj file...
Seems strange that it would fix it. But I'm happy to have an Archived build now.
Check out this link for more info
There is another case similar to the same error. when you have an Embedded Framework project with min iOS 10 (Any iOS Device arm64, arm7) while I am archiving the build of the project with min deployment version iOS 11(Any iOS Device amr64) in Xcode 12.5.1.
I have to change the min deployment version of the Embedded Framework project to iOS 11(Any iOS Device amr64) to match with my project's deployment version.
first build your project command + b and see if the frameworks are in red when you look at then at the right sidebar, if they are, xcode did not find your files on the specified path, if not, building and then archiving should work
I was able to get it to archive by re-creating the project from scratch. I created a new project, used the same pod file to install the pod libraries, then copied everything over from the other project. I am now able to archive it and push it to the store. Must have been some corruption or a rogue setting.
In my case, the module which couldn't be found was a dynamic Obj-C framework with a minimum deployment target higher than my application project's minimum deployment target. Bumping my minimum version fixed it, but you could drop the version on the framework instead.

Can't archive with Xcode 9

I want to archive my app with selecting the Build Option "Generic iOS Device" (and i've done that a couple of times before i upgraded to Xcode 9.2) but unfortunatly it fails every time saying "No such module 'CryptoSwift'".
To make it clear, it doesn't have to do anything with SwiftyBeaver; it maybe have to do with my CocoaPods, maybe they don't like that libraries against the target. Or maybe with Xcode 9.2 itself.
To be more specific, it fails here:
import CryptoSwift //No such module 'CryptoSwift'
Whenever i select the simulator or a device (for building, not archiving), it compiles and everything works as expected.
Any suggestions?
The answere was in the first line of my cocoa pod file:
platform :ios, '11.0'
Instead of using 11.0, i changed it platform :ios, '11'.
And than i had to change the deployment target to 11.2. I don't know, what that was changed to 10.0 but those two changes did it.
So if you guys are using any minor versions of iOS in your pod file and you aren't sure, if it exists, just leave it blank!
Apparently it did cause those No such module '' errors, because the compiler wasn't able to build that frameworks in the Derived folder because it didn't know what iOS Version i wanted them to be built.

How to use Siri Extension on an existing project with Deployment Target 8.0

I have a project on Swift 3.0 and Xcode 8. The deployment target for this project is from 8.0.
Is possible that Siri Extension can be used in this app?
It means, only if users installed the app on ios10-iphone, then siri extension works.
Thanks
The minimum deployment target for Siri is iOS 10. Apple has exposed SirKit in iOS 10 so we can't set the minimum deployment target to something less than iOS 10.
Having said that, you can keep your original app target as it is i.e. 8.0 but when you create Siri extension ( also Siri UI extension), you need to set deployment target to minimum of 10.0. This way all the targets build successfully. Please note that you need minimum of xcode8.

Resources