I am getting an error:
Ambiguous resolution: module ".../myModule.js" tries to require 'react-native', but there are several files providing this module. You can delete or fix them:
.../MyProject/ios/Pods/React/package.json
.../MyProject/node_modules/react-native/package.json
I am almost certain that this is due to using Podfiles, specifically, when they install the "React" folder. However, I had to use Podfiles in order to install react-native-firebase
. With that said, when I delete the React folder under my Pods folder (ios/Pods/React), I can no longer use react-native-firebase
.
There was a fix floating around GitHub, which suggested appending the Podfile with:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
But this did not work for me. Has anyone encountered this problem before?
If it is relevant, this is the podfile that I am using:
platform :ios, '8.0'
target 'MyProject2' do
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'RNSVG', :path => '../node_modules/react-native-svg'
target 'MyProject2Tests' do
inherit! :search_paths
# Pods for testing
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
end
EDIT: When I remove the 'RNSVG' from my Podfile, I get an error stating: "Invariant Violation: Native component for 'RNSVGPath' does not exist". I have both ran react-native link and followed the instructions for manual installation for react-native-svg
.
I had to manually link the React pod to node_modules
:
pod 'React', :path => '../node_modules/react-native'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With