Newly created app crashes on iOS Sim.

So I have a large-ish app that I need to convert to bare workflow. I’m having trouble with that so in an attempt to come up to speed on the process I decided to…

expo init (blank managed workflow)
expo eject
yarn install
cd iOS
pod install
yarn ios

It takes like forever, but eventually the build finishes. When I run the app on a siimulator it crashes on launch with the following error in the crash log.

*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘expo-updates must be configured with a valid update URL or scope key.
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 732.18.0.2 - Device: iPhone 11 (37F9B8F0-7882-48AE-816E-37782DD1FAC4) - Runtime: iOS 13.6 (17G64) - DeviceType: iPhone 11

I searched for others who have bumped into the same error, but found nothing. Anyone have thoughts on how to proceed?

sign in to your expo account before ejecting and it will configure expo-updates for you. otherwise, you need to create Expo.plist and do it manually as described in https://docs.expo.io/bare/installing-updates/

related issue https://github.com/expo/expo-cli/issues/2880

Man you are fast! Thanks for that, I will give it a go.

Another snag. Likely unrelated. I started over and logged in as ‘notbrent’ suggested. This time I get the following error:

The following build commands failed:

** BUILD FAILED **

The following build commands failed:
CopySwiftLibs /Users/davidvernon/Library/Developer/Xcode/DerivedData/myapp-hhuzbxhgarlmwsezkqmhyislmrot/Build/Products/Debug-iphonesimulator/myapp.app
(1 failure)

error Command failed with exit code 1.

Scrolling up I see a more detailed error message:

error: Build input file cannot be found: ‘/Users/davidvernon/Library/Developer/Xcode/DerivedData/myapp-hhuzbxhgarlmwsezkqmhyislmrot/Build/Products/Debug-iphonesimulator/myapp.app/myapp’ (in target ‘myapp’ from project ‘myapp’)

I’ve seen a post on a similar problem, but the solution presented there was to upgrade to now old version of macOS and Xcode. I am on

macOS : 10.15.7
Xcode: 12.2

Thoughts?

clean your build and run it again

Curious…

cd ios
xcodebuild clean
cd …
yarn ios

Produces the same result.

you could try this https://github.com/facebook/react-native/issues/23886#issuecomment-551333349

xcode has some nice features but can be difficult to work with sometimes, so you’ll have to get used to this kind of thing if you’re ejecting :slight_smile:

Oh yes, Xcode is both a blessing and a bane. Could it be that I need a newer or older version (than 12.2)? I have a nice selection of them installed on my computer. (QT is quit picky about Xcode versions.)

cd ios
pod repo update
pod update

rm -rf ios/build
rm -rf ~/Library/Developer/Xcode/DerivedData
watchman watch-del-all
rm -rf node_modules
npm install

That did not do the trick either. The error is the same

error: Build input file cannot be found: ‘/Users/davidvernon/Library/Developer/Xcode/DerivedData/myapp-hhuzbxhgarlmwsezkqmhyislmrot/Build/Products/Debug-iphonesimulator/myapp.app/myapp’ (in target ‘myapp’ from project ‘myapp’)

FWIW, I went and looked and that file is really just not there. Could it be built by hand and dropped in place?

i’d try opening up xcode (xed ios from the root of your project) and then running a build from there. maybe the yarn ios (which runs react-native run-ios) command isn’t working well with multiple xcode versions installed

This is getting curiouser and curiouser…

When I launch via xed (which is a tool I’ve not ever heard of) it brings up the project in Xcode 11.6, and can not read the project file. So I rename Xcode_12_2.app to Xcode.app and …

sudo xcode-select --switch /Applications/Xcode.app

And xed still opens in 11.6. I’m going to move all of the other Xcode’s off this computer and see if I get different results. I expect that it will break the build. If so I will clean and start over.

Wanted to report back. Notbrent, you called it. The issue was that I had multiple Xcode’s installed and for reasons that I do not understand xcode_select was falling. I was switching from 11.6 to 12.2 and the change was not taking.

So I pulled all of them off my computer onto an external drive and reinstalled Xcode from developer.apple.com. That still did not work. I rebooted my Mac and things were find. Go Figure.

Thanks notbrent for your help!