-
Notifications
You must be signed in to change notification settings - Fork 987
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
Xcode 15.0: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99. #1379
Comments
Can you elaborate more on this? Personally I pushed to bump the minimum deployment target for cordova-ios 7 release, but the community kind of voted against it because it was just a warning... and instead favoured to use the lowest deployment target possible. :\ I think you can use the |
This is just a warning and can be ignored. As Norman mentions, you can set |
I appreciate the responses, thanks.
Yes, all seems well with
<preference name="deployment-target" value="12.0"/>
It looks like I can no longer reproduce the build failures I mentioned, so I guess that statement can be ignored, life being short.
Also, apologies for putting this Issue in as a bug when upon reflection working with new versions of things tend to be enhancements. I'm such a noob sometimes.
It feels like there is an enhancement request in here somewhere, because it took me a while to find that deployment-target preference on my own.
Ah, here it is: I would have benefited from a clearer error message. Like, the error message about IPHONEOS_DEPLOYMENT_TARGET is coming from a leaky abstraction -- reporting about something that maybe means something to an XCode user, but doesn't point explicitly back to the relevant cordova-ios
deployment-target preference.
|
The warning comes from XCode. It's part of the native iOS project which has nothing to do with Cordova (from Apple's perspective). So naturally it's not going to provide details to what Cordova may have to configure the project. |
@sbarber2 Did you find that setting the "deployment-target" preference did update the |
I don't think it will affect the CordovaLib project, it only applies to the application project |
Xcode 15 will be mandatory to build apps which can be submitted to the App Store:
Currently, the However this does not apply to
Is there another preference which can be applied to all All other alternatives which require to manually edit the project files will force us to update our CI/CD workflows which are currently generating the iOS and Android platforms from scratch. (For best practice, we only commit the Cordova project to our repo, not the files generated at build time) |
This is not an error, it is only a warning and can be ignored |
We also encountered the same warning. We planned to ignore it for now as @dpogue suggested. |
I will close out this ticket as it is only a warning message and shouldn't cause failures with builds or app store submissions. |
This issue may result in a warning or in an error like in this case:
Increasing the |
@erisu - this is not just a warning if you're using Xcode 15, and per @julfrechette's comment, we are all going to be forced to use it this month. In my case this build error (which prevents compilation and is not just a warning) is due to plugins I'm using that bring in Cocoapods that have their deployment target set to a version <12. This is a problem outside of Cordova as well. For my native apps I've solved the problem by appending this to my
As seen here and in many other SO answers. A temporary workaround to get my Cordova apps to build is to go into Xcode and manually change the deployment target of each offending pod target. However, these changes are all nuked every time I run Is there some way for cordova-ios users to modify the Podfile? It seems there is, but that that is also broken? As I have this in my config.xml:
I really think this issue should be re-opened. |
We solved this using a rather ugly (but working) hack using the following script to post-process the project files. const fs = require('fs');
const path = require('path');
function findFilePathsByFilename(directory, filename) {
const files = fs.readdirSync(directory);
const filePaths = [];
for (const file of files) {
const filePath = path.join(directory, file);
const stats = fs.statSync(filePath);
if (stats.isDirectory()) {
// Recursively search in subdirectories
const subdirectoryFilePaths = findFilePathsByFilename(filePath, filename);
filePaths.push(...subdirectoryFilePaths);
} else if (stats.isFile() && file === filename) {
// If the file matches the filename, add its path to the result
filePaths.push(filePath);
}
}
return filePaths;
}
const paths1 = findFilePathsByFilename('.', 'project.pbxproj');
const paths2 = findFilePathsByFilename('.', 'Pods.xcodeproj');
const paths = paths1.concat(paths2)
console.log('Apply patch to', paths);
for (let path of paths) {
let content = fs.readFileSync(path, { encoding: 'utf-8' });
content = content.replace(/IPHONEOS_DEPLOYMENT_TARGET = [0-9]+.0;/g, 'IPHONEOS_DEPLOYMENT_TARGET = 12.0;');
fs.writeFileSync(path, content);
}
console.log('Done setting IPHONEOS_DEPLOYMENT_TARGET'); |
why is this "closed", since following all the "current"? documentation in https://cordova.apache.org/docs/en/12.x/guide/cli/index.html causes this, and it's not "just a warning" as you get don't you guys dog food your system? |
Bug Report
cordova-lib doesn't directly support Xcode 15.0's minimum target deployment version of 12.0
Problem
Using cordova-lib 12.0.1 with XCode 15.0:
/Users/xxxx/cordova_apps/hello/platforms/ios/CordovaLib/CordovaLib.xcodeproj The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99.
What is expected to happen?
When using XCode 15.0, the IPHONEOS_DEPLOYMENT_TARGET is at least 12.0.
What does actually happen?
When using XCode 15.0, the IPHONEOS_DEPLOYMENT_TARGET is at 11.0, and this causes build errors and/or warnings.
For example:
/Users/xxxx/cordova_apps/xcode15test/platforms/ios/HelloCordova.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'HelloCordova' from project 'HelloCordova')
/Users/xxxx/cordova_apps/xcode15test/platforms/ios/CordovaLib/CordovaLib.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CordovaLib' from project 'CordovaLib')
These are just warnings in the build that occurs using the commands below, but in more complicated builds this version mismatch has caused an error and a failed build.
Information
This is all on MacOS Ventura 13.6.
Command or Code
Install XCode 15.0 or higher
Bring up a Terminal
mkdir cordova_apps
cordova create xcode15test
cd xcode15test
cordova add platform iOS
cordova build iOS
Environment, Platform, Device
This is all on MacOS Ventura 13.6. The machine is a MacBook Air M1.
Version information
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
cordova --version
12.0.0 ([email protected])
No plugins
MacOS Ventura 13.6
XCode 15.0
Checklist
The text was updated successfully, but these errors were encountered: