I updated RNN from 2.16.0 to 2.17.0 today.
After the update I get an error when calling Navigation.setRoot when starting the app.
I tested reverting to 2.16.0 and then it starts working again.
Navigation.setRoot({
root: {
stack: {
children: [
{
component: {
name: 'homeScreen',
},
},
],
},
},
});
I get this error in xcode:
Exception '-[RNNRootViewController initWithLayoutInfo:creator:options:defaultOptions:presenter:eventEmitter:]: unrecognized selector sent to instance 0x106546f60' was thrown while invoking setRoot on target RNNBridgeModule with params (
setRoot3,
{
modals = (
);
overlays = (
);
root = {
children = (
{
children = (
);
data = {
name = homeScreen;
options = {
};
};
id = Component2;
type = Component;
}
);
data = {
};
id = Stack1;
type = Stack;
};
},
56,
57
)
same here
my route looks like below
function registerComponents() {
Navigation.registerComponent('Detail', () => Detail)
Navigation.registerComponent('Preview', () => Preview)
Navigation.registerComponent('Filter', () => Filter)
Navigation.registerComponent(
'Search',
() => props => (
<SearchContextProvider>
<Search {...props} />
</SearchContextProvider>
),
() => Search
)
}
registerComponents()
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setRoot({
root: {
stack: {
children: [
{
component: {
name: 'Search',
options: {
topBar: {
visible: false
}
}
}
}
]
}
}
})
})
it seems related to this change?
Sorry my bad, mine was fixed by putting the following code back in AppDelegate.h, which I need in order to remove Class 'AppDelegate' does not conform to protocol 'RCTBridgeDelegate'
warning according to the doc.
You can remove RCTBridgeDelegate from this file: AppDelegate.h:`
- #import <React/RCTBridgeDelegate.h>
- @interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
+ @interface AppDelegate : UIResponder <UIApplicationDelegate>
Any update on this?
hey @aminosman, we're out of the office for the next couple of days and will get to this on Wednesday. Sorry for the inconvenience.
Thanks @guyca
same here
Same. I only see this error when i run react-native run-ios. If i run the app from xcode in debug mode I don't see the error and can continue programming as usual. This has been my current workaround until it's fixed.
This issue seems to be related to the build cache itself and not to react-native-navigation.
I managed to reproduce the issue, bootstrapped a new RN project with [email protected]
and ran react-native run-ios
, then upgraded to [email protected]
and ran again react-native run-ios
.
The solution is to remove ios/build
folder and run react-native run-ios
.
Thanks for looking into this.
I will give it a try as soon as I have time.
I cleared the build cache and am still seeing this issue
Can you try removing both ios/DerivedData
and ios/build
?
Also delete the app from your device
Deleting the ios/build
folder solved the issue for me. I did not have an ios/DerivedData
folder. Thanks @yogevbd
Ok looks like DerivedData
was the trick, that got it working for me.
Awesome! closing the issue
thanks @shuzootani !
Most helpful comment
This issue seems to be related to the build cache itself and not to react-native-navigation.
I managed to reproduce the issue, bootstrapped a new RN project with
[email protected]
and ranreact-native run-ios
, then upgraded to[email protected]
and ran againreact-native run-ios
.The solution is to remove
ios/build
folder and runreact-native run-ios
.