KMM - How to set iOS deployment target? - kotlin-multiplatform

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

Related

How do you check/change iOS version in React Native?

I heard that a new version of iOS came out the other day, and wanted to know if my React Native project would be using that version by default when I build it with XCode, and if not, how can I force it to?
My Questions Are:
1) How do you check what version of iOS a React Native app is using?
2) How do you update the version of iOS in a React Native app?
UPDATE:
Based on #Simon's answer, I have one more question:
3) What determines the default version that a given project has?
Use Xcode to change an iOS project's target target iOS version. XCode > Project Navigator > "General" tab > Deployment Info > Target. You will the "ios/Quevera.xcodeproj/project.pbxproj" file will now have an entry like "IPHONEOS_DEPLOYMENT_TARGET = 11.0;".
Go to ios folder and then go to Podfile. At the top, find ios version and change it.

Invalid deployment target of the framework

I want to decrease the framework deployment target from iOS 10 to iOS 9. I did the fork of the library, changed deployment target of the framework TARGET (not whole project). When I build the dependency I can see in info.plist that deployment target is iOS 9 (screenshots attached) in the framework and iOS 8 in the framework's dependency. Anyway, my project where I attach those still outputs that iOS 10 is required for this framework (yes, i did clean, delete derived data, change simulator, reset xcode).
.../MyFile.swift:13:8: Module file's minimum deployment target is ios10.0 v10.0:
.../MapFramework.framework/Modules/MapFramework.swiftmodule/arm64.swiftmodule
(that's in Swift file in the line where I have import MapFramework)
The issue was happening, because by mistake, there were two copies of the same .framework in the file hierarchy. One was in Carthage folder, another one in root folder. Even though marking in Xcode -> Reveal in Finder on the framework it always shown framework in Carthage folder, somehow it was processing both of these. After removal of the framework located in root folder everything was working perfectly fine (I didn't have to change any paths or references in Xcode, what shows that Xcode all of the time was pointing to the correct version).
Seems like an Xcode bug.

How to solve iOS deployment target issue?

I am trying to run an application I am developing on an iPhone that runs iOS 10.2.1. I also tried to run it on a simulator that runs iOS 10.2. My Xcode version is 8.3.3. Even though I changed the deployment target to 8.0, I get the following error when I try to run it on a device under 10.3. Are there other things I should pay attention when changing the deployment target other than changing it from Info tab in Xcode? The error states the deployment target as 10.3 but it is not. How can I get around this issue?
"Run destination is not valid for running the scheme.."
My deployment target
Thank you,
I remember the same issue happening in my code.
In my case, I realized that I had not updated my Base SDK to the latest iOS version in the Build Settings
To do so, click on Project name -> Build Settings -> Base SDK
If Base SDK does not show, ensure that "All" is selected in the filter at the top of the page.
Also, sometimes the project has multiple targets and you might be setting the Base SDK on the wrong target.
You need to update your iphone to the newer version or downgrade your xcode version. Currently they are out of sync thus why you are seeing this error.
See here for compatibility:
https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html

Storyboard File Inspector

I submitted my app yesterday and i want this to run on iOS 6.0 and later operating systems.I have set the Deployment Target to 6.0 and Base SDK to Latest iOS(iOS 7.1).Is it ok?
Furthermore i would like to know which is the right selection for storyboard file in File Inspector Tab and in Interface Builder Document Section.Here is a screenshot:
I have chosen Project Deployment Target(6.0) for Builds For option.Is there any problem with this?Where does this option refers to?Cause there is an option iOS 6.0 and later also to choose.So which of these two options i have to choose?
I have set the Deployment Target to 6.0 and Base SDK to Latest iOS(iOS
7.1).Is it ok?
YES
I have chosen Project Deployment Target(6.0) for Builds For option.Is
there any problem with this?
NO, Its just a minimum target.

Xcode IOS Deployment target Options

In Xcode there are 5 columns when entering the Deployment target like shown below.
Resolved / AppName / Config (Pods) / App Name/ IOS Default
What are all these columns/options for? Is there not just one IOS Deployment Target for the app.
I understand that because I use Cocoa pods there could be a separate deployment type for the pods, but why the two columns with app name and ios default etc?
Each of the columns is a different place in the build system "hierarchy" where the value can come from. The rightmost is the default built into Xcode; moving from right to left, there's the overall project, the config file from Cocoapods, the per-target config, and the value that will actually take effect. If your project is part of a workspace, there's a level there, too.
You're right that for an app, there can be only one deployment target. But you can have more than one app in a project, and could have different deployment targets for each. Say you have the older version of your app that works all the way back to iOS 4.3, and a newer version that only works in iOS 7 and later. You could have them both be part of the same project in Xcode and use a different deployment target for each.

Resources