Closed adamski closed 8 years ago
I don't know which version you had before, but maybe the native code is not in sync with the JS code.
In version 1.2.6 the setRootController
method was changed to receive an additional parameter, but this is not a breaking change since the JavaScript wrapper takes care of the the default value.
The only option I see for this error to happen is if the native code in your project is not up to date and your JS code is (native code is older and receives 2 parameters and the JS code is newer and sends 3 parameters).
If this is not the case - have you tried to:
I've killed and restarted the packager. I've cleaned the Xcode project inc derived data, and watchman watch-del-all
. No joy yet...
Did you try to check if the issue is because of the "out of sync" reason I mentioned?
In the native code in RCCManagerModule.m
look at the setRootController
method; It should get 3 arguments: layout, animationType, globalProps. This should match index.js
having a call with 3 arguments for setRootController
: RCCManager.setRootController(layout, animationType, passProps)
.
Yes I had a look, the definition i see is:
setRootController:(NSDictionary*)layout animationType:(NSString*)animationType globalProps:(NSDictionary*)globalProps)
and in index.js
ControllerRegistry: {
registerController: function (appKey, getControllerFunc) {
_controllerRegistry[appKey] = getControllerFunc();
},
setRootController: function (appKey, animationType = 'none', passProps = {}) {
var controller = _controllerRegistry[appKey];
if (controller === undefined) return;
var layout = controller.render();
_validateDrawerProps(layout);
RCCManager.setRootController(layout, animationType, passProps);
}
},
❓
Unless there is some other layer of caching I have not yet found....!?
The code seems to be in sync.. Very weird.
The previous working version I was using was 1.2.4 so that accounts for the error thats coming up, but have no idea why. About to rebuild the Xcode project to see if that helps..
After spending many hours trying to work this out, I found that there was an out of date static library libReactNativeControllers.a
in build/Products/Debug-iphonesimulator
. Simply deleting it and rebuilding solved the issue. It seems that the Pod static libraries are now being saved in their respective folders e.g. build/Products/Debug-iphonesimulator/ReactNativeControllers/libReactNativeControllers.a
.
I'm getting this error now, after updating to 2.03 but can't seem to track down why ... I'm using a fork but only adding a Podspec and the rest should be identical. Any ideas? I've deleted my
node_modules
folder,npm install
and done apod install
but still getting this error...