New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 11.3 XCode 9.3 (9E145) don't build #18638

Closed
DLevai94 opened this Issue Mar 31, 2018 · 46 comments

Comments

Projects
None yet
@DLevai94

DLevai94 commented Mar 31, 2018

I've updated XCode to 9.3 (9E145) and iPhone X to 11.3 and now my project isn't building. It doesn't work with iOS 11.2 simulator too. But it works with react-native run-ios

Environment:
OS: macOS High Sierra 10.13.4
Node: 9.2.0
Yarn: 1.5.1
npm: 5.8.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.5 => 0.49.5

Steps to Reproduce

Update iDevice and Xcode then try to build.

Expected Behavior

Build success

Actual Behavior

Build fails.

/Users/*****/node_modules/react-native/Libraries/Text/RCTTextField.m:131:108: Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead

RCTLogWarn(@"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.", self.text, eventLag);

Enum values with underlying type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead

Sometimes it's RCTImage, RCTImageCache, etc..

@react-native-bot

This comment has been minimized.

Collaborator

react-native-bot commented Mar 31, 2018

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.54?

Thank you for your contributions.

@Jemian

This comment has been minimized.

Jemian commented Apr 1, 2018

This is my problem, too. I have xcode 9.2 and ios 11.3. I am too new at coding to know how to post an error message. Sorry.

This picture is the error message I receive.
"Could not locate device support files.

This iPad Pro (9.7 inch)(Model A1674, A1675) is running iOS 11.3(15E216) which may not be supported by this version of Xcode."

I'm hoping to learn a work-around.

@spikeisryu

This comment has been minimized.

spikeisryu commented Apr 1, 2018

Same problem. I just updated Xcode to 9.3(9E145) and the same errors occur when I try to archive. Different part is building for simulator is fine, but only archive or building for generic iOS device have the problem.
I was about to submit a build, but suddenly can't upload a new build to itunesconnect. =(
Any clue?

@ken-talkingsource

This comment has been minimized.

ken-talkingsource commented Apr 2, 2018

Same problem.
react-native version: "0.42.0"
Xcode: 9.3(9E145)
Many type error happened with RCTLogWarn ?
(%zd?)

@fenglu09

This comment has been minimized.

fenglu09 commented Apr 2, 2018

Same problem.
react-native version: 0.43.2
If i open my project with Xcode 9.2 it was built success. Open with Xcode: 9.3 was built failed with error.

@RamboLouis

This comment has been minimized.

RamboLouis commented Apr 2, 2018

Same problem.
react-native version: 0.46.4
Xcode 9.2 was built success, Xcode 9.3 was built failed.

@dangjian

This comment has been minimized.

dangjian commented Apr 2, 2018

Sam problem.
react-native: 0.47.2
xCode 9.3

@philly25

This comment has been minimized.

philly25 commented Apr 2, 2018

Yes, problem appears only when trying to make Product -> Archive.

RN: 0.46.4
Xcode 9.3

I have other error:

/node_modules/react-native/Libraries/Image/RCTImageCache.m:28:55: Enum values with underlying type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead

@teyou

This comment has been minimized.

teyou commented Apr 2, 2018

RN 0.49.3
Xcode 9.3
have the same issue

/node_modules/react-native/Libraries/Image/RCTImageCache.m:28:55: Enum values with underlying type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead

UPDATED SOLUTION (choose 1 from below)

  1. downgrade to XCode 9.2
  2. Upgrade to latest RN version
  3. manually apply the patch on multiple NSString stringWithFormat method which has %zd format

change %zd to %lld and add (long long) into respective format
link to sample patch:

was

return [NSString stringWithFormat:@"%@|%g|%g|%g|%zd|%@",
imageTag, size.width, size.height, scale, resizeMode, responseDate];

after apply patch:

return [NSString stringWithFormat:@"%@|%g|%g|%g|%lld|%@",
imageTag, size.width, size.height, scale, (long long)resizeMode, responseDate];

@peteroid

This comment has been minimized.

peteroid commented Apr 2, 2018

Having the same issue with the same env of @teyou

At the end I downgraded the Xcode to 9.2 to archive the app. I just wondered why Apple doesn't mention this such breaking change in the release note of Xcode 9.3.

Xcode 9.2

@mickey13

This comment has been minimized.

mickey13 commented Apr 2, 2018

@teyou Thanks for that. Updating React Native to the latest version breaks my iOS (and Android) build for a new set of reasons. I may need to use your suggestion.

@bsiddiqui

This comment has been minimized.

bsiddiqui commented Apr 2, 2018

@mickey13 you can also downgrade xcode.

I've been using the xcode beta when building the app through simulator and using an older version when archiving with xcode. It's annoying but a decent fix until you have time to upgrade react-native.

@hramos

This comment has been minimized.

Contributor

hramos commented Apr 2, 2018

Has anyone reproduced this in 0.54?

@ken-talkingsource

This comment has been minimized.

ken-talkingsource commented Apr 3, 2018

I use @teyou 's solution 3 and modified about 3 ~ 4 files
Built successfully.

@dangjian

This comment has been minimized.

dangjian commented Apr 3, 2018

@peteroid thank you for the solution. It is a high risk to upgrade the RN version. For now, downgrading to Xcode 9.2 is the best solution.

@donnycrash

This comment has been minimized.

donnycrash commented Apr 3, 2018

@hramos I had a similar issue with 0.47 and after upgrading to 0.54 the build works.

@skraloupak

This comment has been minimized.

skraloupak commented Apr 3, 2018

Yeah cool, dowgrade to Xcode 9.2 works. Thanks for the solution.

@DLevai94

This comment has been minimized.

DLevai94 commented Apr 3, 2018

@hramos Maybe this guy is on 0.54.4 and same issue? #18650

@ocarreterom

This comment has been minimized.

ocarreterom commented Apr 3, 2018

@hramos I don't have any problems on RN 0.54.4 running on iOS 11.3 with Xcode 9.3 (9E145)

@fmoessle

This comment has been minimized.

fmoessle commented Apr 3, 2018

I had the same issue using RN 0.47

Try to upgrade your RN Version via this guide: https://github.com/ncuillery/rn-diff

@hramos hramos closed this Apr 3, 2018

@hramos hramos added the Fixed label Apr 3, 2018

@andrejunges

This comment has been minimized.

andrejunges commented Apr 4, 2018

any workaround for older versions? (besides downgrading xcode)

@nmolkeri

This comment has been minimized.

nmolkeri commented Apr 6, 2018

I work on a company product, I am then releasing the app so Ic an downgrade the Xcode to 9.2 and make a work around for it. But what about other developers at different location? They are gonna think I messed up the code as I am the one releasing the code. Also my company has policy to not upgrade the RN version from 0.44.3 to any higher version. This is gonna be hassle.

@edencakir

This comment has been minimized.

edencakir commented Apr 6, 2018

@andrejunges You can use XCode quick fix tool (tap on the red circle).

@skaan

This comment has been minimized.

skaan commented Apr 7, 2018

Just quick fixing with xcode solved this for me, thanks!!

@jeffzing

This comment has been minimized.

jeffzing commented Apr 8, 2018

now i take the downgrade solution,keep watching

@navata

This comment has been minimized.

navata commented Apr 9, 2018

We must downgrade Xcode
Don't have any solution?

@afdhald

This comment has been minimized.

afdhald commented Apr 9, 2018

try this:

RCTLogWarn(@"Native TextInput(%@) is %ld events ahead of JS - try to make your JS faster.", self.text, (long)eventLag);

@waisbek

This comment has been minimized.

waisbek commented Apr 11, 2018

Upgrading the react-native: 0.49.3 to react-native: 0.55.2, now it working.

@navata

This comment has been minimized.

navata commented Apr 11, 2018

I try to upgrade RN 0.47 to RN 0.5x. But It have many issues and not working with other library old. Do you have this issue?!

@waisbek

This comment has been minimized.

waisbek commented Apr 11, 2018

I had merge conflict in android_manifest and a file that contain the numbers of build/certificates in iOS. I resolved this conflicts and now the iOS build works.

@Obooman

This comment has been minimized.

Obooman commented Apr 13, 2018

I tried update react-native from 0.48 to 0.54, everything seems fine - NO errors should be fixed.
If there are errors with third-party dependencies, don't forget to update them to the latest version.

@antoinerousseau

This comment has been minimized.

Contributor

antoinerousseau commented Apr 13, 2018

To make @teyou's third solution work, I also had to cast eventLag to long in RCTTextView.m:238, RCTTextField.m:93 and RCTTextInput.m:90 (i.e. replace eventLag by (long)eventLag)

@DLevai94

This comment has been minimized.

DLevai94 commented Apr 13, 2018

with React Native 0.55 it's ok 👍

@marcosluizfp

This comment has been minimized.

marcosluizfp commented Apr 14, 2018

@teyou's third solution + @antoinerousseau additions worked for me.
Thank you guys!

@chetstone

This comment has been minimized.

Contributor

chetstone commented Apr 15, 2018

Yes it's risky to patch RN but it's a little safer if you create a patch script that's run in npm/yarn postinstall. That way, if you have to reinstall RN your patches will be automatically applied.

In package.json add:
"postinstall": "bin/patch33x.sh"

The patch script and data are in my gist.

Note that I'm patching RN 0.33 so my patch file may not work on your version. Some of the changes are the same as mentioned above, some are different.

I'm still stuck on RN 0.33 because I still support iOS 7. And I can't downgrade to Xcode 9.2 because my test device is already on iOS 11.3 (I sent in the phone for a battery replacement and it came back with the upgrade).

Thanks @teyou, @antoinerousseau and @edencakir .

EDIT:
I forgot to mention how to create the patch file, which you'll need to do, since you probably can't use mine.

With a clean react-native:

cd node_modules
cp -pr react-native react-native.orig

Then build with xcode, click on the little red dot, fix the error, and repeat till you've fixed all these casting errors. Then:

diff -Naur --exclude='*.plist' react-native.orig react-native > ../notes/rn33.3x.patch
@jasongaare

This comment has been minimized.

Contributor

jasongaare commented Apr 16, 2018

Thanks @chetstone for the tips on the patch -- works like a charm!

@yuyao110120

This comment has been minimized.

yuyao110120 commented Apr 18, 2018

RN 0.54.2 and 0.55.3

Xcode 9.3 archive success.

But when export archive select certificate, show error 'Profile doesn't include the beta-reports-active entitlement.'

Xcode 9.2 no problem.

@franj0

This comment has been minimized.

franj0 commented Apr 19, 2018

Hi guys, I had same issue.
Try next steps:

  1. Close all js http://localhost:8081/debugger-ui in browser
  2. Open incognito/private window of browser
  3. Put app under debug mode(debug JS Remote)
  4. Clean project in xCode cmd+shift+k
  5. Archive

It's wierd solution, but wors for me, ty

image
image

@navata

This comment has been minimized.

navata commented Apr 20, 2018

Hi all,
Do we must to upgrade RN for this issue?
No anything solution other ?

@franj0

This comment has been minimized.

franj0 commented Apr 20, 2018

@navata did u try my solution 'couz I did't upgrade RN

@areeb111

This comment has been minimized.

areeb111 commented Apr 21, 2018

In Xcode just hover the error line and then you will find FIX button press it and re-Archive.

Etheryte pushed a commit to Etheryte/react-native that referenced this issue Apr 24, 2018

@wkwyatt

This comment has been minimized.

wkwyatt commented Apr 26, 2018

@peteroid How do you find Xcode version 9.2 in that link you posted?

@navata

This comment has been minimized.

navata commented Apr 26, 2018

@wkwyatt you can find in https://developer.apple.com/downloads/index.action (login with account Apple developer)

@MacKentoch

This comment has been minimized.

Contributor

MacKentoch commented May 5, 2018

I confirm @areeb111 solution (and thank him): simply let xcode fix the issues in native code.

Then ensure closing previously running react-native server (react-native start) before starting after xcode auto-fixes

@tcagkansokmen

This comment has been minimized.

tcagkansokmen commented May 6, 2018

need help, I upgrade RN 0.46.4 to 0.54 and it gives so many errors like; react-native-impelementations (on checkbx) etc.

is there any solution without updating react native?
I'm gonna kill myself now

@Anton22seven

This comment has been minimized.

Anton22seven commented May 14, 2018

Mine seems to archive after update to 9.3.1

@facebook facebook locked as resolved and limited conversation to collaborators May 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.