React-native: iOS build fails to run in with Xcode 11.0 beta

Created on 4 Jun 2019  ·  24Comments  ·  Source: facebook/react-native

React Native version:

Steps To Reproduce

1.Create a new react-native project with react-native init ""
2.open iOS project and run

Describe what you expected to happen:
Build and run successfully and show launch screen with default UI

What is happening:
Build shows Error Screen saying -
"Unknown argument type '__attribute__' in method -[RCTAppState getCurrentappState:error:].
Extend RCTConvert to support this type

Snack, code example, or link to a repository:
Happens with all my existing projects and newly created samples as well.Here is the sample code I have tried.
FinalTry.zip

Please refer to below screenshot for error data
Simulator Screen Shot - iPhone Xʀ - 2019-06-04 at 12 30 26

NOTE:
Happens only in newly launched MacOS and Xcode 11 beta

Bug iOS Fixed Locked

Most helpful comment

fixed by #25146

All 24 comments

OMG, seems Xcode 11 beta breaks method signature parsing. Now I have no chance to install Xcode beta. @vivekhumnabad Would you mind paste the method selector string for us? just add the NSLog like below.

image

fixed by #25146

@ericlewis Any idea when this will be released???

@vivekhumnabad needs to be accepted and merged, which shouldn't take long, and after maybe @grabbou wouldn't mind pulling it in to the 0.60 RC, since it is a pretty minor change? :D

@vivekhumnabad its been merged, this will land hopefully in 0.60 or 0.61!

Would it be possible to get a fix in version precceding 0.60? Say 59?
(0.60 completely breaks a lot of third party packages that are no longer supported)

@ollydixon This fix is already part of the 59.9 react-native.

I am still facing this issue on

react natvie :0.59.3

@MuhammadUsman786786
According to Betko's post, it is included in 0.59.9, you are using 0.59.3. You will need to upgrade to see the fix.

Does it affect on users upgraded to ios13 with apps that is currently in store?

@Desintegrator Users who are on iOS13 can download and run React Native 0.59.<9 apps from the play store, as long as they are built with Xcode 10. The issue is when building apps with Xcode 11 (which is required to run locally on iOS 13 devices).

OMG, dường như Xcode 11 beta phá vỡ phân tích chữ ký phương thức. Bây giờ tôi không có cơ hội để cài đặt Xcode beta. @vivekhumnabad Bạn có phiền dán chuỗi chọn phương thức cho chúng tôi không? chỉ cần thêm NSLognhư dưới đây.

Hình ảnh, tưởng tượng

not work for me

fixed by #25146

https://github.com/facebook/react-native/pull/25146/files that work in my case, react-native 0.59.8

react-native 0.52.3

fix xcode 11 beta

code ./node_modules/react-native/React/Base/RCTModuleMethod.mm
Replace
return RCTReadString(input, "__unused") ||
RCTReadString(input, "__attribute__((unused))");
To
return RCTReadString(input, "__attribute__((unused))") ||
RCTReadString(input, "__attribute__((__unused__))") ||
RCTReadString(input, "__unused");

fixed by #25146

https://github.com/facebook/react-native/pull/25146/files that work in my case, react-native 0.59.8

it works for me. do reinstall the app after replace

@Desintegrator Users who are on iOS13 can download and run React Native 0.59.<9 apps from the play store, as long as they are built with Xcode 10. The issue is when building apps with Xcode 11 (which is required to run locally on iOS 13 devices).

What about app from the store that is currently run React Native 0.55.0?

Thanks, @CaopanHuster for confirming about 0.59.8. Is this change available on RN 0.59.8? I can't upgrade my RN version further 0.59.8.

@NguyenVanVietPoLy "RCTReadString(input, "__attribute__((__unused__))")" adding this worked for me on 0.57.4

react native 0.59.9 solved this problem.
but if you want to keep 0.59.0~0.59.8
find the file here: node_modules/react-native/React/base/RCTModuleMethod.mm
at line 93 add:
static BOOL RCTParseUnused(const char **input) { return RCTReadString(input, "__unused") || RCTReadString(input, "__attribute__((__unused__))") || //solve by add this line RCTReadString(input, "__attribute__((unused))"); }

This issue still exists in xcode 11.1 and rn 0.59.9. Do I have to update to 0.6**?Thanks.

Yes, upgrade to the latest version of react-native.

fixed by https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190

it works for me.
but if you want to keep a stable version
update here: node_modules/react-native/React/base/RCTModuleMethod.m
then patch-package,patch-package lets app authors instantly make and keep fixes to npm dependencies.

if ([@(input) hasPrefix:@"getCurrentAppState"]){
NSLog(@"@", @(input))
}

react native 0.59.9 solved this problem.
but if you want to keep 0.59.0~0.59.8
find the file here: node_modules/react-native/React/base/RCTModuleMethod.mm
at line 93 add:
static BOOL RCTParseUnused(const char **input) { return RCTReadString(input, "__unused") || RCTReadString(input, "__attribute__((__unused__))") || //solve by add this line RCTReadString(input, "__attribute__((unused))"); }

Worked for me

Was this page helpful?
0 / 5 - 0 ratings