Skip to content

Pods version conflict #5061

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
5 of 6 tasks
KristianDD opened this issue Oct 8, 2019 · 3 comments · Fixed by #5058
Closed
5 of 6 tasks

Pods version conflict #5061

KristianDD opened this issue Oct 8, 2019 · 3 comments · Fixed by #5058
Assignees
Milestone

Comments

@KristianDD
Copy link
Contributor

KristianDD commented Oct 8, 2019

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI:
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime:
  • Plugin(s):

Describe the bug

When a plugin requires a different version of MaterialComponents than tns-core-modules-widgets there is an error on pod install step in the build proces.

To Reproduce

1 Create new project
2 Add /App_Resources/iOS/Podfile with content pod 'MaterialComponents/Tabs', '< 84.4'

Expected behavior
To have a way to resolve such conflicts without plugin modification.

Solution
A property overridePods has been introduced in nsconfig.json. This property will cause all plugin pods to be overridden by the pods in the /App_Resources/iOS/Podfile.

Acceptance Criteria

  • 1. Change of overridePods in nsconfig.json should regenerate platforms/ios/Podfile
  • 2. Add or remove of pod in /App_Resources/iOS/Podfile should comment/uncomment a pod that is defined in a plugin in the final Podfile in platforms/ios/Podfile (when overridePods is enabled).
  • 3. Newly added plugin should have the pods that match the ones in /App_Resources/iOS/Podfile commented in the final podfile platforms/ios/Podfile (when overridePods is enabled).
  • 4. If there is a conflict in versions a Tip with a reference to article should be printed by the CLI.
  • 5. Check plugin add and nsconfig.json change between runs.
  • 6. Project should work when overridePods is true and Podfile missing in /App-Resources/iOS/ folder

To cause a CocoaPod conflict use the attached to the issue plugin.
plugin.zip

@farfromrefug
Copy link
Contributor

being the developer of nativescript-material-components i am really waiting for this ;)
Also could we have a way to do that from plugins?
I mean nativescript-material-components should be able to say that it wants to use a newer version for example

@KristianDD
Copy link
Contributor Author

KristianDD commented Oct 9, 2019

Hi @farfromrefug ,
This feature was intentionally targeted to application developers. The way the plugin defines its required pod version is by the Podfile inside src/platforms/ios/. If multiple plugins require conflicting version (impossible/contradicting requirements) we leave to the application developer to find a version of the specific pod that works with both and define it inside his application Podfile in App_Resources\iOS\ and set overridePods: true in nsconfig.json.

For example if we have the following requirements in one plugin:

pod 'MaterialComponents/Tabs', '~> 84.4'

and in another plugin:

pod ‘MaterialComponents/Tabs’, ‘< 83.0’

This condition is impossible to satisfy programatically, so the user should:
a. Find compatible versions of the plugins.
b. Find a version of the pod that will work with both plugins, and force its usage disregarding the plugins requirements using the feature described above.

@farfromrefug
Copy link
Contributor

@KristianDD That makes sense. I guess my issue is now with {N} forcing version '~> 84.4'

Thanks!

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

Successfully merging a pull request may close this issue.

3 participants