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.
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 😄
@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
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 endIt'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.
Couldn't get react-native-splash-screen to work due to this Pod stuff.
solved by https://github.com/crazycodeboy/react-native-splash-screen/issues/344#issue-393738215
solved by #344 (comment)
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
same issue. Any solution?
same here please