react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

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

Open code-by opened this issue 3 years ago • 15 comments

🐛 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',
            },
          },
        ],
      },
    },
  });
});
  1. 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

  • React Native Navigation version: 7.24.3-hotfix.1
  • React Native version: 0.67.2
  • Platform(s): iOS 15
  • Device info: Simulator, xCode 13, debug executable

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?

  • ✖️   No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

code-by avatar Feb 08 '22 00:02 code-by

after clean project mentioned error has gone, build passed

code-by avatar Feb 08 '22 09:02 code-by

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.

djMax avatar Feb 14 '22 23:02 djMax

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)

hugo-chq avatar Feb 15 '22 06:02 hugo-chq

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

yz1311 avatar Feb 16 '22 14:02 yz1311

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"

wilhelmusw avatar Feb 24 '22 22:02 wilhelmusw

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.

anhtuank7c avatar Feb 25 '22 13:02 anhtuank7c

@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

punjasin avatar Feb 26 '22 09:02 punjasin

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

itsam avatar Mar 07 '22 08:03 itsam

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

samzmann avatar Mar 07 '22 09:03 samzmann

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

anhtuank7c avatar Mar 09 '22 10:03 anhtuank7c

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.

Tstepro avatar Mar 12 '22 20:03 Tstepro

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

aburduk avatar Mar 14 '22 15:03 aburduk

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 ..",

oskarhertzman avatar Jun 08 '22 11:06 oskarhertzman

@oskarhertzman you're a literal G

aymather avatar Aug 03 '22 21:08 aymather

@oskarhertzman you're a literal G

Happy to help! Glad it worked.

oskarhertzman avatar Aug 03 '22 21:08 oskarhertzman