XCode 11 Beta App Launch Crash
pramodsharma403 opened this issue ยท 25 comments
React Native version:
"react": "16.8.3",
"react-native": "0.59.8"
No other dependency added.
Steps To Reproduce
- Create a fresh project with react-native init ProjectName
- Open iOS project in XCode 11 beta & run your project.
- npm start
- App crash with -
Unknown argument type 'attribute' in method -[RCTAppState getCurrentAppState:error:]. Extend RCTConvert to support this type.
Error Log from XCode -
Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 1 beyond bounds [0 .. 0]' was thrown while invoking getCurrentAppState on target AppState with params (
2,
3
)
Describe what you expected to happen:
App should not get crash.
Snack, code example, or link to a repository:
@pramodsharma403 Hi, thanks for reporting, we already fixed it, please see #25138. We may cherry-pick it in next release.
I am also encountring the same problem on iOS, after Xcode update. I do not want to update to react-native 0.60
Version is react-native 0.59.3
I solved the issue by upgrading react-native to 0.59.9 version.
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
resolved using this method #25146 (comment)
react-native upgrade 0.59.9, yarn , yarn pods seemed to do the trick for me
Not working on Xcode 11 GM seed
Encountered this issue in Xcode 11. :(
please try this solution ... #25146 (comment)
open file in yourproject /node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as quote below:
static BOOL RCTParseUnused(const char **input)
{
return RCTReadString(input, "attribute((unused))") ||
RCTReadString(input, "attribute((unused))") ||
RCTReadString(input, "__unused");
}
link here
0.59.9 has solved this.
If for some reason you can't upgrade right now, do this as suggested by @saudahmed
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
@decodedmrq this actually works.
But what happend? The only updated thing is IDE, no libraries were updated and moreover it was runing fine even after XCode updated. Just run into it after weekend.
react-native upgrade 0.59.9, yarn , yarn pods seemed to do the trick for me
thanks, saved my day.
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
@saudahmed You saved my day, this works for me.
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
thanks, is working :)
0.59.9 has solved this.
THaNkS
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
thank You
clean build folder
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
thank You
This approach makes all my text input colors white and I can no longer change it in style={{ color }} how can I fix this?
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
This worked for me
As I still did not see any thing that works here. Adding what worked for me.
Source https://stackoverflow.com/questions/58336836/react-native-crash-after-update-to-xcode-11-0
To fix this issue, open file in
yourproject/node_modules/react-native/React/Base/RCTModuleMethod.mm.
Then correct as below:
https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
in your project directory, open file in myproject/node_modules/react-native/React/Base/RCTModuleMethod.mm. Then correct as below: https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
this works