Create-react-native-app: Xcode won't compile a fresh-ejected app

Created on 29 Mar 2017  路  22Comments  路  Source: expo/create-react-native-app

Please make our job easier by filling this template out to completion. If you're requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

Looks like at some point in the eject process when generating the ios project #import <React/RCTDevSettings.h> is being referenced and can't be found.

Expected Behavior

I was expecting it to run as a normal react-native app.

Observed Behavior

I was expecting it to compile normally as a react-native app would. Both in Xcode and running react-native run-ios but then this happened:

In file included from /Users/patrickbassut/Programming/beebo/.expo-source/ios/ios/Exponent/Versioned/Modules/Internal/EXDevSettings.m:3:
/Users/patrickbassut/Programming/beebo/.expo-source/ios/ios/Exponent/Versioned/Modules/Internal/EXDevSettings.h:3:9: fatal error: 'React/RCTDevSettings.h' file not found
#import <React/RCTDevSettings.h>
        ^
1 error generated.


** BUILD FAILED **



The following build commands failed:
    CompileC /Users/patrickbassut/Programming/beebo/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/ExpoKit.build/Objects-normal/x86_64/EXDevSettings.o /Users/patrickbassut/Programming/beebo/.expo-source/ios/ios/Exponent/Versioned/Modules/Internal/EXDevSettings.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/beebo.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/beebo.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Environment

Please run these commands in the project folder and fill in their results:

Also specify:

  1. Operating system: macOS 10.12.4 (16E195)
  2. Phone/emulator/simulator & version: Trying to compile to 10.3

Reproducible Demo

create-react-native-app myApp
yarn run eject // Chose to use a Expo account and still have expo SDK
react-native run-ios // breaks

Most helpful comment

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/SampleApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

All 22 comments

Hi! Thanks for the report! We discovered this earlier today, and I'm in the process of releasing a fix for it.

I looked for it and it wasn't reported. Thus I created the issue.
Lost a few good hours thinking the issue was on my end.
So glad you guys are already working on it.

Thanks so much!

If you change your package.json so that the react-native dependency matches this:

"react-native": "https://github.com/expo/react-native/archive/sdk-15.0.0.tar.gz"

and you follow this guide you should be able to get things building. I'll close this when the fix is released.

And to be clear -- the issue was reported outside of GitHub, no duplicate issue here. Thanks for checking first though! Makes life a lot easier :D

@dikaiosune Thanks for the fast response! You're a wizard!

Hey guys, I'm still getting this issue with the latest version :(

@pyankoff can you paste the contents of your package.json?

Hi @dikaiosune Thank you for quick reply! Sure:

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "jest-expo": "^0.3.0",
    "react-test-renderer": "~15.4.1"
  },
  "main": "index.js",
  "scripts": {
    "test": "node node_modules/jest/bin/jest.js --watch"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "expo": "^15.1.0",
    "react": "~15.4.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-15.0.0.tar.gz"
  }
}

Used the same process:
create-react-native-app myApp
yarn run eject // Chose to use a Expo account and still have expo SDK
react-native run-ios // breaks

@pyankoff have you read the guide? IIRC it's linked from the CRNA docs and from the eject completion message.

I did, I even used exp detach and managed to run detached ios app before. Did I miss anything?

Oh I'm sorry, I forgot that doc was split up, I was referring to https://docs.expo.io/versions/v15.0.0/guides/expokit.html. The thing I noticed in your comment above is that you used react-native run-ios in an ExpoKit project, which I don't think works.

No worries, I figured you meant both docs. Yeah, I picked up running with react-native run-ios from this thread, but I'm getting the same error when trying to run the project from xcode.

What's the error when running from Xcode?

/test/.expo-source/ios/ios/Exponent/Versioned/Modules/Internal/EXDevSettings.h:3:9: 'React/RCTDevSettings.h' file not found

/test/.expo-source/ios/ios/Exponent/Versioned/Modules/Internal/EXDevSettingsDataSource.h:4:9: 'React/RCTDevSettings.h' file not found

Can you try re-installing node_modules (delete n_m, then reinstall) followed by a pod install?

Now it builds! Thank you!

Hooray!

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/SampleApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

@rachurirkk did you resolve that problem, I did an eject and I also get that error. Tried to reinstall node_modules and also pods

Hi,
I have the same issue as @rachurirkk even after rm n_m and reinstall + pod install.
pod install returns following error (don't know if it's normal or not):
[!] No `Podfile' found in the project directory.

I cannot run from XCode neither

Thanks

@comur is here a Podfile in that directory? It should be located insode the ios folder.

After reading many message boards, I had to only upgrade from Xcode 9.2 to 9.3 and it compiled.

Was this page helpful?
0 / 5 - 0 ratings