react-native-orientation-locker
react-native-orientation-locker copied to clipboard
react-native-orientation-locker OrientationModule Conflicting with react-native-sensors
Describe the bug
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 did you find an solution for this?
Same issue
I have the exact same problem any solution to use both libs together?
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.
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.