Git Product home page Git Product logo

Comments (5)

breautek avatar breautek commented on August 27, 2024 1

but I think if my config.xml file has all Pod dependecies should be installed with 13.0 version.

I don't think deployment-target does all pod dependencies, but it maintains the app's Podfile and that is what I observed in the steps I've taken as detailed in #1422 (comment)

If you're still reproducing the issue then confirm that you're running the latest cordova CLI and platform version and share sample project that reproduces the issue that we can look at. If a sample reproduction project cannot be provided then I don't think there's anything we can do to move this forward.

from cordova-ios.

breautek avatar breautek commented on August 27, 2024

This was an issue in cordova-ios 6.3 but I believe was patched in 7.0 (definitely in 7.1).

I have a google maps plugin that requires iOS 15 and I used to manually workaround this issue but it was corrected after I updated my projects to 7.1.

I used:

<platform name="ios">
  <preference name="deployment-target" value="15.0" />
</platform>

adding the plugin and then the platform works as expected, with the generated podfile properly containing 15.0 instead of the default 11.0. This also works if you add the platform first, or use the preference outside of the <platform name="ios"> block. Updating the preference and running cordova prepare ios also shows the changes reflected in both the platform's Podfile and config.xml.

The deployment-target set in the root config.xml should be reflected in the platforms/ios/[App Name]/config.xml before any script or process accesses it.

The expectation of "any script or process" is not quite right. The platform files (including config.xml and Podfile) gets updated during the prepare step, so if you're using an hook, script or process that runs before prepare (such as before_prepare hook) for example, that will run before the config.xml file is updated inside the platform project, and that would be desired behaviour because the hook is for manipulating things before cordova does things. after_prepare is a hook for after cordova manipulates things, etc.

I can not reproduce the issue using the current version of cordova-ios. Simply adding a plugin in which requires a higher deployment target of 11 is not enough to reproduce the issue. If you can provide a sample reproduction project, it may help us understanding the full scope of when the issue reproduces.

from cordova-ios.

expcapitaldev avatar expcapitaldev commented on August 27, 2024

breautek hi! thanks a lot for your activity here. FBSDKCoreKit https://github.com/CocoaPods/Specs/blob/master/Specs/9/b/5/FBSDKCoreKit/17.0.0/FBSDKCoreKit.podspec.json#L13 is required 12.0
you can try add in any your plugin and do clean build.

<podspec> <config> <source url="https://cdn.cocoapods.org/"/> </config> <pods use-frameworks="true"> <pod name="FBSDKCoreKit" spec="17.0.0"/> </pods> </podspec>
Can you share method or line in cordova-ios library which will be copy deployment-target value from config.xml to Podfile ? I see only https://github.com/apache/cordova-ios/blob/master/lib/Podfile.js#L40 which try to copy value but that value will be empty before installation first pod library

from cordova-ios.

breautek avatar breautek commented on August 27, 2024

breautek hi! thanks a lot for your activity here. FBSDKCoreKit https://github.com/CocoaPods/Specs/blob/master/Specs/9/b/5/FBSDKCoreKit/17.0.0/FBSDKCoreKit.podspec.json#L13 is required 12.0
you can try add in any your plugin and do clean build.

I still could not reproduce the issue. The config.xml gets copied into platform resources pretty early on in the prepare step. I don't quite remember exactly where it happens in the code. But here's what I did:

I've created a test plugin to wrap around the podspec, the test plugin is effectively just has an empty package.json and the plugin.xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
           id="test-plugin"
      version="5.0.1-dev">

    <name>test</name>
    <description>Cordova test Plugin</description>

    <platform name="ios">
        <podspec>
            <config>
                <source url="https://cdn.cocoapods.org/" />
            </config>
            <pods use-frameworks="true">
                <pod name="FBSDKCoreKit" spec="17.0.0"/>
            </pods>
        </podspec>
    </platform>
</plugin>

I npm pack the plugin which gives a .tgz file.

In a test cordova project, which was empty with no platforms or plugins installed with a base config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloCordova</name>
    <description>Sample Apache Cordova App</description>
    <author email="[email protected]" href="https://cordova.apache.org">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
</widget>

I added my test-plugin using a command like: cordova plugin add file:../test-plugin/test-plugin-1.0.0.tgz

The plugin gets added successfully. Not installed at this point because there are no platforms. Just added to the project.

Then I add the platform: cordova platform add ios which this installs cordova-ios 7.1.0

The platform is added successfully, but it does fail to completley install the test plugin because the default deployment target is 11.0, as expected since we didn't explicitly declare an alternate deployment-target preference yet.

So we modify our config.xml and add:

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

and then run cordova prepare ios, which updates the Podfile and runs pod install, and the FBSDK is installed to the project as expected.

from cordova-ios.

expcapitaldev avatar expcapitaldev commented on August 27, 2024

I think expected if I do clean build and have inside my main config.xml <preference name="deployment-target" value="13.0" /> and do cordova prepare ios platform shoould be successfully added and prepared with all Pod dependencies without any additional changes. And now my platform should be ready for cordova compile ios command. So, if current flow unexpected please close current issue but I think if my config.xml file has <preference name="deployment-target" value="13.0" /> all Pod dependecies should be installed with 13.0 version.

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.