react-native-navigation
react-native-navigation copied to clipboard
[iOS 15] Semantic Issue. No member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'
🐛 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
-
npx react-native init awesomeapp
-
yarn add react-native-navigation
-
npx rnn-link
- 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',
},
},
],
},
},
});
});
- 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.
after clean project mentioned error has gone, build passed
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.
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)
resolved by 'rm -rf Pods' & 'pod install'
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"
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 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
@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
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
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
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.
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
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 you're a literal G
@oskarhertzman you're a literal G
Happy to help! Glad it worked.