React-native-gesture-handler: Duplicate module name: react-native

Created on 8 Jan 2019  路  5Comments  路  Source: software-mansion/react-native-gesture-handler

The podspec cause the problem as below when I try react-native start after pod install.

Loading dependency graph...(node:73522) UnhandledPromiseRejectionWarning: Error: jest-haste-map: @providesModule naming collision:
  Duplicate module name: react-native

React is deprecated in Cocoapod.

RNGestureHandler.podspec

s.dependency "React" 

And it makes others confused even they are using react-native link instead of cocoapod.

Most helpful comment

My point is that if you're linking a React Native library through Podfile, then you're basically forced to include React Native/yoga to your project through Podfile too. And after that you're forced to include all other React Native libraries through Podfile as well.

I may be wrong in something, but before I switched from cocoapods to including React Native libraries manually, it was very painful for me to upgrade React Native, because there're usually many pods-related bugs in React Native. And since React Native developers don't use cocoapods, it's more likely to be broken comparing to manual linking. Just sharing my experience.

All 5 comments

Do you have React installed as a pod too? I mean not as a pod-pod, but as a pod-linked-to-node_modules.

@angly-cat I'm not sure I fully understand your question but I do not have a reference to React in my Podfile if that is what you are asking.

@angly-cat @chrisjasp It looks like same case of this issue. https://github.com/AlexanderZaytsev/react-native-i18n/issues/170

IT can be solved to config project's podfile. Official.

My point is that if you're linking a React Native library through Podfile, then you're basically forced to include React Native/yoga to your project through Podfile too. And after that you're forced to include all other React Native libraries through Podfile as well.

I may be wrong in something, but before I switched from cocoapods to including React Native libraries manually, it was very painful for me to upgrade React Native, because there're usually many pods-related bugs in React Native. And since React Native developers don't use cocoapods, it's more likely to be broken comparing to manual linking. Just sharing my experience.

@JeffGuKang I had the same issue and it was solved by adding React/Yoga to my podfile like @lebedev suggested:

pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
Was this page helpful?
0 / 5 - 0 ratings