If an app has multiple plugins and they have podfiles with a platform defined like
platform :ios, '9.0'
the combined podfile will have multiple platform lines and the build will fail.
iOS
[email protected]
[email protected]
[email protected]
Create an app, add [email protected], add [email protected]. Try to build app for iOS.
Reported in https://github.com/NativeScript/nativescript-imagepicker/issues/186
Is there any resolution to this? It seems that the CLI, when merging plugin podfiles, should check for platform :ios conflicts and fix them, probably by keeping only the one with the highest version number.
(It looks like this would happen in cocoapods-service:applyPluginPodfileToProject().)
+1 from kinvey-nativescript-sdk plugin. https://github.com/Kinvey/nativescript-sdk/blob/master/platforms/ios/Podfile#L1
+1 nativescript-plugin-firebase
+1 nativescript-stripe
Anyone here have a workaround for this? This seems like a major issue and it's currently blocking us from using another plugin.
One work around if you are building locally:
You can first build the project, remove the extra platform line from the built Info.plist inside platforms/ios and build again without removing the platforms folder of course. You have to do this every time you build after removing the platforms folder though.
In our case we also want to use nativescript sidekick, and I do not know what to do in that case, so other suggestions would be nice.
I have found with nativescript-firebase if you completely remove the "ml_kit" entry from firebase.nativescript.json then it does not emit the platform :ios line. That was enough to solve the problem for me.
Since NativeScript doesn't seem to be doing anything about this, maybe plugin authors should just remove that line from their Podfiles, document which iOS version the plugin requires, and rely on developers to honor it. I'd be happy to do that for nativescript-stripe until NativeScript addresses this issue if it will help anyone.
@RobertGardner what if I am using the ml_kit library, and need to have it in the .json file?
Is someone looking at this???
It looks like a Bug label was added on May 21, but has there been activity since then? What is NativeScript's official response to this?
A workaround that can be done at install time (as opposed to build time as suggested by @burkongla ) would be to find platforms/ios/Podfile for the offending plugin(s) and delete the platform ios line there. This would only need to be done when you (re)install the plugins (such as after npm i) instead of after every build.
I don't use NativeScript Sidekick, so I don't know if it tries to reinstall the plugins on every build (though that could be time consuming, so I doubt it).
+1 nativescript-mediafilepicker plugin: https://github.com/jibon57/nativescript-mediafilepicker/blob/eea3d3c1d2323a75a4c84e598bfcf4932fd101af/src/platforms/ios/Podfile#L1
Fixed in nativescript@rc, will be released with [email protected]
Have in mind that if your pod file is already corrupted with multiple declarations of platform:ios you will have to delete the platforms folder of your project in order to apply the new tns behavior for podfiles.
@endarova this is incredibly exciting news! Worthy of a blog post about just this alone ;) @rosen-vladimirov 馃
Same problem with nativescript feedback plugin
https://github.com/EddyVerbruggen/nativescript-feedback/issues/49
Hey @vforv ,
Can you please try with latest CLI (5.2.2) - just execute npm install -g nativescript@latest to get it on your machine. After that, delete your platforms directory and try tns run ios again.
Works, thanks! How can I make change localy? When I try tns update it still setting old version of cli.
@vforv in your local project, you shouldn't have reference to nativescript package - this us the CLI, so it is expected to have other only globally
Most helpful comment
Fixed in nativescript@rc, will be released with [email protected]
Have in mind that if your pod file is already corrupted with multiple declarations of platform:ios you will have to delete the platforms folder of your project in order to apply the new tns behavior for podfiles.