1

I'm writing a cordova plugin and I have a framework I'm adding with cocoapod. The framework has a minimum ios requirement of version 13.0. When my pod file is generated it is defaulting to ios 10.0. How do I set the required IOS version in my plugin.xml?

plugin.xml snippets:

<engines>
        <engine name="cordova" version=">=6.0.0" />
        <engine name="cordova-android" version=">=9.0.0" />
        <engine name="cordova-ios" version=">=5.1.0" />
</engines>

 <platform name="ios">
    ...
    <podspec>
        <config>
            <source url="https://cdn.cocoapods.org/"/>
        </config>
        <pods use-frameworks="true">                
            <pod name="ArcGIS-Runtime-SDK-iOS" spec="100.10" />
        </pods>
    </podspec>
</platform>

podfile created:

source 'https://cdn.cocoapods.org/'
platform :ios, '10.0'
use_frameworks!
target 'testPluginApp' do
  project 'testPluginApp.xdodeproj'
  prod 'ArcGIS-Runtime-SDK-iOS', '100.10'
end
Jay Bowman
  • 69
  • 9

2 Answers2

0

My guess is that the iOS 10.0 platform is coming from the Cordova plugin.xml. Perhaps tied to the 5.1.0 version of cordova-ios?

I am not a Cordova developer, but you could try setting the deployment-target in your config.xml. See here (scroll down to deployment-target).

A quick Google search would indicate that this is the expected way to resolve this, but that it is a bit touchy.

Nixta
  • 464
  • 2
  • 10
  • I have traced through the cordova code and using the perference tag in your config.xml is the correct way to do this. But it doesn't work. I've submitted a bug issue on cordova's github page. – Jay Bowman Mar 24 '21 at 17:29
  • I've tested with multiple versions of cordova-ios 4.8, 5.1.1, and latest to see if the bug is fixed in a different version but it doesn't work in any of them. – Jay Bowman Mar 24 '21 at 17:36
  • Yeah. It seems not to work tremendously well. Some people have mentioned that they had to resort to manually modifying the podfile. I presume what you have above isn't copied and pasted directly though, because "preference" is spelled incorrectly. If it is, that might be the issue :) – Nixta Mar 24 '21 at 18:41
0

Setting the deployment-target in the config.xml is correct.

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

However, the pod file will only be updated if you add the ios platform again before calling cordova prepare or cordova build.

My final working solution:

cordova platform add ios && cordova prepare ios && cordova build ios

which results into

platform :ios, '13.0'