Package Not Mantained - needs to be Manually removed
fabOnReact opened this issue · 3 comments
I SOLVED
I leave the post for future reference
Hello
I am trying to remove react-native-orientation, but for some reason unlinking did not work and I still have the native code used inside AppDelegate.m ios file
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import "Orientation.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTBridge.h>
- Add node_modules/react-native-orientation/iOS/RCTOrientation.xcodeproj to your xcode project, usually under the Libraries group
It's not there
-
Add libRCTOrientation.a (from Products under RCTOrientation.xcodeproj) to build target's Linked Frameworks and Libraries list
-
Add $(SRCROOT)/node_modules/react-native-orientation/iOS/RCTOrientation/ to Project Name -> Build Settings -> Header Search Paths
Was there - Removed but still fails the build
I also removed the following line, and now my project works.
//#import "Orientation.h" // <--- import
@implementation AppDelegate
// ...
//- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
// return [Orientation getOrientation];
// }
@end
The following fork is actively mantained
https://github.com/wonday/react-native-orientation-locker
Currently I am very busy and I am struggling so please help me
thanks
@fabriziobertoglio1987 What is the alternative solution you've come across?
Removing this dependency and installing
Like @fabriziobertoglio1987 I switched to this other package and I have no issues on iOS or Android
https://github.com/wonday/react-native-orientation-locker