Skip to content
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

Should this library be included using Pods? #203

Open
adrienthiery opened this issue Apr 30, 2018 · 8 comments
Open

Should this library be included using Pods? #203

adrienthiery opened this issue Apr 30, 2018 · 8 comments

Comments

@adrienthiery
Copy link

Hi there,

Had a bunch of problems because react-native link added a line to ios/Podfile automatically.
So I tried to make it work with it in the Podfile, but then the React pod was installed as a dependency and it was a mess.

Is that the expected behaviour? Or should users not use that method?

In the end, coming back to the readme, I removed the line from the Podfile and followed the manual installation steps for iOS and everything seems to work out.

My question is:
Should we add to the readme that you should NOT use it with Pods, or add instructions on How to make it work with Pods?

I can do a PR to add a warning, but I wouldn't how to make instructions properly to make it work with Pods. I feel that you would need to go through all the steps in https://facebook.github.io/react-native/docs/integration-with-existing-apps.html#3-install-cocoapods but I'm not 100% comfortable with that kind of setup.

@fabioh8010
Copy link

To prevent React pod to be installed as dependency just add those lines at the end of Podfile:

target 'YourApp' do
  # YOUR PODS
end

# lines to add
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

It's not a problem with this library 😄

@6gunner
Copy link

6gunner commented Jun 7, 2018

@adrienthiery Have you solved this problem ?
I am also confusing how to make it work with Podfile
I am trying to add pod 'react-native-splash-screen', :path => '../node_modules/rn-splash-screen/rn-splash-screen.podspec'
But I am not sure is it work

@codeword
Copy link

codeword commented Oct 2, 2018

To prevent React pod to be installed as dependency just add those lines at the end of Podfile:

target 'YourApp' do
  # YOUR PODS
end

# lines to add
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

It's not a problem with this library 😄

the React cocoapod is a deprecated library according to their homepage, so this library is dependent on a deprecated library. It is a problem with this library.

The original posters question still stands. Why is there a cocoapod for this library? It seems like the NPM Module ships with the IOS code, so the linking should just point to the IOS code under the node_modules. I don't see any 3rd party IOS code that this library is actually dependent on that should be brought in via cocoapods.

@RohitRox
Copy link

RohitRox commented Oct 4, 2018

Couldn't get react-native-splash-screen to work due to this Pod stuff.

@kaixiniOSTT
Copy link

solved by #344 (comment)

@rob-not-bob
Copy link

solved by #344 (comment)

#344 Does not address the heart of this issue.

The main issue is that the manual setup does not mention cocoapods at all and that react-native link react-native-splash-screen automatically adds react-native-splash-screen to the Podfile when it is not necessary.

For reference @6gunner, You can get this working with cocoapods by directing it to React and yoga in your node_modules.

target 'YourApp' do
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

  pod 'React', :path => '../node_modules/react-native'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
end

@ghasemikasra39
Copy link

same issue. Any solution?

@jodavaga
Copy link

same here please

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

No branches or pull requests

9 participants