wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

[iOS 15] Semantic Issue. No member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions' #7442

Open code-by opened 2 years ago

code-by commented 2 years ago

🐛 Bug Report

I have create app from scratch, then run it both in Android and iOS perfectly. After adding RNN latest version iOS xCode 13 Run/build failed: /node_modules/react-native/React/CoreModules/RCTActionSheetManager.mm:98:35: No member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

  1. npx react-native init awesomeapp
  2. yarn add react-native-navigation
  3. npx rnn-link
  4. made changes in index.js according the docs:
    import {Navigation} from 'react-native-navigation';
    import App from './App';
    Navigation.registerComponent('com.awesomeapp.Start', () => App);
    Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setRoot({
    root: {
      stack: {
        children: [
          {
            component: {
              name: 'com.awesomeapp.Start',
            },
          },
        ],
      },
    },
    });
    });
  5. run project from xCode

Expected behavior

App should run in iOS emulator same as in Android device w/o errors

Actual Behavior

iOS xCode 13 Build failed: No member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'

(Write what happened. Add screenshots, if applicable.)

Your Environment

Reproducible Demo

AppDelegate.m

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
[ReactNativeNavigation bootstrapWithBridge:bridge];

  return YES;
}

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
  return [ReactNativeNavigation extraModulesForBridge:bridge];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end

Are you willing to resolve this issue by submitting a Pull Request?

code-by commented 2 years ago

after clean project mentioned error has gone, build passed

djMax commented 2 years ago

Although that works for me too, it comes back randomly, so there must be some reason for it. For a large project, having to clean the build is less than ideal.

hugo-chq commented 2 years ago

the same issue happens with "react-native-screens": "^2.0.0", "react-native": "0.67.2", iOS 15.2 , (currently upgrading , but might be useful to know)

yz1311 commented 2 years ago

resolved by 'rm -rf Pods' & 'pod install'

wilhelmusw commented 2 years ago

getting same issue. tried cleaning project and reinstalling pods but still not working.

"@react-navigation/native": "^6.0.8",
"react": "17.0.2",
"react-native": "0.67.3",
"react-native-safe-area-context": "^4.0.1",
"react-native-screens": "^3.12.0"
anhtuank7c commented 2 years ago

I have the same issue. Just following these step:

cd ios && pod deintegrate
rm -rf Podfile.lock
pod install

after that open in Xcode then clean & rebuild It finally work.

punjasin commented 2 years ago

@anhtuank7c problem is i have to do this everytime i npm install or add new lib if not deintegrate pod it will always build failed

itsam commented 2 years ago

I

@anhtuank7c problem is i have to do this everytime i npm install or add new lib if not deintegrate pod it will always build failed

I confirm this as well

samzmann commented 2 years ago

As much as I like to complain about RNN, I think this time it's not their fault ^^ I was able to reproduce this issue on a new RN project after adding just one native dependency (not RNN). See this issue https://github.com/facebook/react-native/issues/33174

anhtuank7c commented 2 years ago

I follow this comment to create a patch package to fix this, it just works. https://github.com/facebook/react-native/issues/33174#issuecomment-1057025719 https://www.npmjs.com/package/patch-package

Tstepro commented 2 years ago

after clean project mentioned error has gone, build passed

How did you clean the project? What do you mean by that? I'm assuming you did something like this.

Just following instructions from the link, opening up the react-native project in xcode and clicking (from the menubar) Product > Build Clean Folder worked for me.

Edit: Added link.

aburduk commented 2 years ago

after clean project mentioned error has gone, build passed

How did you clean the project? What do you mean by that? I'm assuming you did something like this.

Just following instructions from the link, opening up the react-native project in xcode and clicking (from the menubar) Product > Build Clean Folder worked for me.

Edit: Added link.

Thanks, this resolved for me

oskarhertzman commented 2 years ago

this script has resolved alot of headaches for me:

  "ios:clean": "rm -rf ~/Library/Caches/CocoaPods && rm -rf Pods 
  && rm -rf ~/Library/Developer/Xcode/DerivedData/* && cd ios 
  && xcodebuild clean && pod cache clean --all && pod deintegrate 
  && pod setup && pod install --verbose && cd ..",
aymather commented 2 years ago

@oskarhertzman you're a literal G

oskarhertzman commented 2 years ago

@oskarhertzman you're a literal G

Happy to help! Glad it worked.