Closed beetlebum closed 3 years ago
Same issue here.
XCode: 12 RN: 0.63
Publish v0.0.19
After upgrading to 0.0.19 I'm getting the following error when compiling my app for iOS:
/node_modules/react-native-restart/ios/Restart.m:9:38: error: too many arguments to function call, expected 0, have 1 RCTTriggerReloadCommandListeners(@"react-native-restart: Restart");
"react": "16.9.0" "react-native": "0.61.5" "react-native-restart": "0.0.17"
Xcode: 12.3
Note: Downgrade to 0.0.17 fixed my problem
In my tests removing the reason solved the problem, but for others it didn't. I deprecated 0.0.19 in the meanwhile
The reason is necessary in the latest versions of React Native:
void RCTTriggerReloadCommandListeners(NSString *reason)
The changes was introduced in October 2019, https://github.com/facebook/react-native/commit/2a13f121060b9aeda96ed424901156c617bfe6ce#diff-6949450901d2737f9bdbc690d57bab78ac0d966243fa63e0bc6a8425c418ebec
The user above is using React Native 0.61, there should be two versions of this library for 0.62 and above and below.
@beetlebum thanks. Got an idea how to detect the RN version on the native code?
@beetlebum thanks. Got an idea how to detect the RN version on the native code?
I think you could just leave 0.18 for users on 0.61 and below and re release 0.19 with a warning on the README
I prefer creating a solution with backwards compatibility, but if I won't find one I'll fall back to README
~I wonder if we can do something like this: https://github.com/tessus/react-native-version-info/blob/9593b559f8a325a18c3e1ffa834fba915c8e09e1/ios/RNVersionInfo.m#L19~ nvm, this is not what I thought it was
UPDATE: After researching about this, I'm not sure how can we have this backwards compatible if the function's typedef has changed?
RCT_EXTERN void RCTTriggerReloadCommandListeners(void);
vs
RCT_EXTERN void RCTTriggerReloadCommandListeners(NSString *reason);
Even if we're able to identify the RN version (I'm not sure how), we'll still have build-time errors, won't we?
I prefer creating a solution with backwards compatibility, but if I won't find one I'll fall back to README
we should probably update react-native version in the package.json to 0.62
though
I have a bit of a legacy app running react-native: 0.60.3
Ran into the iOS build error with react-native-restart: 0.0.22
/node_modules/react-native-restart/ios/Restart.m:9:38: error: too many arguments to function call, expected 0, have 1 RCTTriggerReloadCommandListeners(@"react-native-restart: Restart");
is downgrading to react-native-restart: 0.0.18 still the recommended approach?
Seems with
react-native-restart: 0.0.18
iOS isn't restarting in production release, not throwing error, just not restarting. It is working in dev/debug build.
Android version is working in both as expected.
After upgrading to 0.0.18 I'm getting the following error when compiling my app for iOS: