Giter Site home page Giter Site logo

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. about cordova-ios HOT 15 CLOSED

sbarber2 avatar sbarber2 commented on May 24, 2024 6
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.

from cordova-ios.

Comments (15)

amcalgates avatar amcalgates commented on May 24, 2024 5

@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 Podfile:

post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
            end
        end
    end
end

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 cordova build ios.

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:

<preference name="deployment-target" value="12.0" />

I really think this issue should be re-opened.

from cordova-ios.

dpogue avatar dpogue commented on May 24, 2024 2

setting that preference doesn't seem to change the CordovaLib target.

I don't think it will affect the CordovaLib project, it only applies to the application project

from cordova-ios.

sc0ttdav3y avatar sc0ttdav3y commented on May 24, 2024 1

Hi there!

I've got this as well, and I'm hoping someone with more brains than I can kindly point me in the right direction?

In my case, I run:

cordova build ios --debug

and I get:

/app/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment 
target versions is 12.0 to 17.2.99. (in target 'XXXXXX' from project 'Pods')

where XXXXXX is repeated for a bunch of low-level pods. The pod names seem to be a dependency of a dependency so I'm not sure what they are, but I can see that one of them is 'CordovaLib' from project 'CordovaLib' but there are many more as well.

In my config.xml I have set <preference name="deployment-target" value="15.0" />, and I can see the generated Podfile has this in it, so it appears to be honouring the preference:

# DO NOT MODIFY -- auto-generated by Apache Cordova
source 'https://cdn.cocoapods.org/'
platform :ios, '15.0'
use_frameworks!
target 'MyApp' do
	project 'MyApp.xcodeproj'
	pod 'CocoaLumberjack', '~> 3.7.2'
	pod 'MLKitTextRecognition'
end

I'm not entirely sure what Cordova does under the hood beyond that, but I can see in XCode it shows iOS 11
as the deployment target despite the Podfile and the preference:

Screenshot 2023-12-20 at 4 32 21 pm

Any help from the cordova-ios brains trust to point me in the right direction would be appreciated!

Also, love your work and thanks!

from cordova-ios.

dpogue avatar dpogue commented on May 24, 2024 1

However this does not apply to CordovaLib.xcodeproj which triggers the a similar build error:

***/platforms/ios/CordovaLib/CordovaLib.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.2.99. (in target 'CordovaLib' from project 'CordovaLib')

This is not an error, it is only a warning and can be ignored

from cordova-ios.

erisu avatar erisu commented on May 24, 2024 1

I will close out this ticket as it is only a warning message and shouldn't cause failures with builds or app store submissions.

from cordova-ios.

connyhald avatar connyhald commented on May 24, 2024 1

This issue may result in a warning or in an error like in this case:

clang: error: SDK does not contain 'libarclite' at the path '/Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a'; try increasing the minimum deployment target

** ARCHIVE FAILED **

Increasing the IPHONEOS_DEPLOYMENT_TARGET of the lib helps here but it looks like we can only set it using Xcode and not as configuration which would be needed for CI/CD, etc...

from cordova-ios.

breautek avatar breautek commented on May 24, 2024

cordova-lib is the cordova shared JS library, so I moved this ticket to the more appropriate repo for you.

but in more complicated builds this version mismatch has caused an error and a failed build.

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 deployment-target preference to override it, so that might also be a workaround for the time being.

from cordova-ios.

dpogue avatar dpogue commented on May 24, 2024

This is just a warning and can be ignored.

As Norman mentions, you can set <preference name="deployment-target" value="12.0" /> in config.xml to force a specific deployment target

from cordova-ios.

sbarber2 avatar sbarber2 commented on May 24, 2024

from cordova-ios.

breautek avatar breautek commented on May 24, 2024

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.

from cordova-ios.

mpmontanez avatar mpmontanez commented on May 24, 2024

@sbarber2 Did you find that setting the "deployment-target" preference did update the IPHONEOS_DEPLOYMENT_TARGET setting in CordovaLib.xcodeproj? For me, setting that preference doesn't seem to change the CordovaLib target.

from cordova-ios.

sc0ttdav3y avatar sc0ttdav3y commented on May 24, 2024

This further info may help.

If I search for IPHONEOS_DEPLOYMENT_TARGET in platforms/ios, it shows a mix of targets in the Pods project:

Screenshot 2023-12-20 at 5 01 11 pm

I spotted this warning as well:

The `My App [Release]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-My App/Pods-My App.release.xcconfig'. This can lead to problems with the CocoaPods installation

Unfortunately for me, coming from a web developer background, so I'm a bit like that meme where I don't know what pods are and at this point I'm too afraid to ask :-)

Through trial and error I found a plugin that was causing this (for me it was plugin-cordova-ml-text).

My mental model is that the plugin was referencing pods that had lower build targets. Interestingly, I still see some lower numbered deployment targets in the Podfile (down to 9.0) and in CordovaLib (down to 11.0) after removing that plugin, but my project compiles now.

Here's my same search afterward in case (less bad targets but still some):

Screenshot 2023-12-20 at 6 11 36 pm

I'm not sure if this is a problem with cordova-ios or not — I don't quite understand it all — but TL;DR from me is to remove your plugins one by one until it works. 🤷🏻

from cordova-ios.

julfrechette avatar julfrechette commented on May 24, 2024

Xcode 15 will be mandatory to build apps which can be submitted to the App Store:

Please note that as of April 2024 all iOS and iPadOS apps submitted to the App Store must be built with a minimum of Xcode 15 and the iOS 17 SDK.

Currently, the MyProject deployment minimum version can be updated using:
<preference name="deployment-target" value="12.0" />

However this does not apply to CordovaLib.xcodeproj which triggers the a similar build error:

***/platforms/ios/CordovaLib/CordovaLib.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.2.99. (in target 'CordovaLib' from project 'CordovaLib')

Is there another preference which can be applied to all .xcodeproj dependencies generated in the iOS platform and not just MyProject?

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)

from cordova-ios.

ChiragMoradiya avatar ChiragMoradiya commented on May 24, 2024

We also encountered the same warning. We planned to ignore it for now as @dpogue suggested.

from cordova-ios.

connyhald avatar connyhald commented on May 24, 2024

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');

from cordova-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.