react-native: XCode 11 Beta App Launch Crash

React Native version: “react”: “16.8.3”, “react-native”: “0.59.8”

No other dependency added.

Steps To Reproduce

  1. Create a fresh project with react-native init ProjectName
  2. Open iOS project in XCode 11 beta & run your project.
  3. npm start
  4. 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:

Adding a screenshot for more clarification below. Screenshot 2019-06-05 at 5 22 00 PM

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 69
  • Comments: 25 (1 by maintainers)

Commits related to this issue

Most upvoted comments

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

I solved the issue by upgrading react-native to 0.59.9 version.

react-native upgrade 0.59.9, yarn , yarn pods seemed to do the trick for me

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

Hello … I am running RN version 0.57.0 … recently updated xcode to version 11.0 … and I am facing this issue … how can I resolve this ? Don’t want to upgrade to RN 0.60.x …

image

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

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

thanks, is working 😃

i have same problem Simulator Screen Shot - iPhone 11 Pro Max - 2019-09-23 at 10 19 53