Skip to content

iOS build breaks with multiple plugins with podfiles #3604

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

Closed
lini opened this issue May 21, 2018 · 17 comments
Closed

iOS build breaks with multiple plugins with podfiles #3604

lini opened this issue May 21, 2018 · 17 comments

Comments

@lini
Copy link
Contributor

lini commented May 21, 2018

Tell us about the problem

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.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

[email protected]
[email protected]
[email protected]

Please tell us how to recreate the issue in as much detail as possible.

Create an app, add [email protected], add [email protected]. Try to build app for iOS.

Reported in NativeScript/nativescript-imagepicker#186

@RobertGardner
Copy link

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().)

@NickIliev
Copy link
Contributor

@sivamamidi-REISys
Copy link

+1 nativescript-plugin-firebase

@burkongla
Copy link

+1 nativescript-stripe

@jjstrat3
Copy link

jjstrat3 commented Dec 3, 2018

Anyone here have a workaround for this? This seems like a major issue and it's currently blocking us from using another plugin.

@burkongla
Copy link

burkongla commented Dec 3, 2018

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.

@RobertGardner
Copy link

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.

@GeorgeKyriakou
Copy link

@RobertGardner what if I am using the ml_kit library, and need to have it in the .json file?
Is someone looking at this???

@RobertGardner
Copy link

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).

@nericode
Copy link

nericode commented Feb 10, 2019

@endarova
Copy link
Contributor

endarova commented Feb 25, 2019

  • Verify if you have plugins with podfiles with specified platform version in them (platform :ios, '9.0'), when building only the highest platform version specified will be used.
  • Verify if you have podfile in AppResources folder with specified platform version in it (platform :ios, '9.0'), when building only that version will be respected
  • Verify when plugins with podfiles with specified platform in them and podfile in AppResources folder without specified platform in it, the highest platform version from plugin podfiles will be used.
  • Verify if you have plugins with podfiles with specified platform without version (platform :ios) the highest available version will be used
  • Verify changes in platform versions in podfiles are updated on livesync
  • Verify when add/delete podfiles platform versions are updated

@endarova
Copy link
Contributor

endarova commented Feb 26, 2019

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.

@ghost ghost removed the in testing label Feb 26, 2019
@NathanWalker
Copy link
Contributor

@endarova this is incredibly exciting news! Worthy of a blog post about just this alone ;) @rosen-vladimirov 🤗

@vforv
Copy link

vforv commented Mar 11, 2019

Same problem with nativescript feedback plugin
EddyVerbruggen/nativescript-feedback#49

@rosen-vladimirov
Copy link
Contributor

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.

@vforv
Copy link

vforv commented Mar 11, 2019

Works, thanks! How can I make change localy? When I try tns update it still setting old version of cli.

@rosen-vladimirov
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests