react-native-orientation-locker icon indicating copy to clipboard operation
react-native-orientation-locker copied to clipboard

react-native-orientation-locker OrientationModule Conflicting with react-native-sensors

Open stanlygamer opened this issue 3 years ago • 5 comments

Describe the bug image

To Reproduce Steps to reproduce the behavior:

Override OrientationModule when two packages installed.

install react-native-orientation-locker & react-native-sensors When build in development throwing error as per screen shot above. Expected behavior Orientation module name should be renamed or should implement canOverrideExistingModule. It should run with both packages.

Desktop (please complete the following information):

React Native Version: 0.63.4

stanlygamer avatar Apr 04 '21 08:04 stanlygamer

@stanlygamer did you find an solution for this?

aditya1711 avatar Apr 21 '21 11:04 aditya1711

Same issue

nkulic avatar Apr 26 '21 19:04 nkulic

I have the exact same problem any solution to use both libs together?

Osamasomy avatar May 05 '21 10:05 Osamasomy

I've been having a similar issue. When building with both libraries installed, I get the following errors:

duplicate symbol '_OBJC_CLASS_$_Orientation' in:
    /Users/<user>/Library/Developer/Xcode/DerivedData/<target>/Build/Products/Debug-iphoneos/RNSensors/libRNSensors.a(Orientation.o)
    /Users/<user>/Library/Developer/Xcode/DerivedData/<target>/Build/Products/Debug-iphoneos/react-native-orientation-locker/libreact-native-orientation-locker.a(Orientation.o)
duplicate symbol '_OBJC_METACLASS_$_Orientation' in:
    /Users/<user>/Library/Developer/Xcode/DerivedData/<target>/Build/Products/Debug-iphoneos/RNSensors/libRNSensors.a(Orientation.o)
    /Users/<user>/Library/Developer/Xcode/DerivedData/<target>/Build/Products/Debug-iphoneos/react-native-orientation-locker/libreact-native-orientation-locker.a(Orientation.o)

Both of these libraries have a file called Orientation.h. When attempting to use react-native-orientation-locker in my Xcode project, I had to change my import from "Orientation.h" to "react-native-orientation-locker/Orientation.h", but I'm still receiving the above build error.

Edit: react-native-sensors v7.2.1-rc.2 seems to fix the issue on iOS, but Android is still experiencing it.

bqrichards avatar Jun 07 '21 15:06 bqrichards

The module named "Orientation" is taken by org.wonday.orientation.OrientationModule as well as com.sensors.RNSensor (react-native-sensors) when sensor of name "Orientation" is made. It looks like less work to rename this module from "Orientation" to "OrientationLocker" than it would be to rename all the sensors from react-native-sensors (although it only requires Orientation to be renamed, that library would want consistent naming, hence the multiple renames). I'll see if I can throw a PR together for this issue.

bqrichards avatar Jun 14 '21 20:06 bqrichards