yamill/react-native-orientation

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>
  1. Add node_modules/react-native-orientation/iOS/RCTOrientation.xcodeproj to your xcode project, usually under the Libraries group

It's not there

  1. Add libRCTOrientation.a (from Products under RCTOrientation.xcodeproj) to build target's Linked Frameworks and Libraries list
    Screen Shot 2019-10-23 at 17 30 49

  2. 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

Screen Shot 2019-10-23 at 17 25 27

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

https://github.com/wonday/react-native-orientation-locker

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