aws-samples/aws-sdk-js-tests

React Native iOS build fails with unable to open file (in target "reactnative" in project "reactnative")

Closed this issue ยท 5 comments

Describe the bug
React Native iOS build fails with unable to open file (in target "reactnative" in project "reactnative")

Error log
yarn run v1.22.10
$ (cd packages/react-native && yarn ios)
$ react-native run-ios
info Found Xcode workspace "reactnative.xcworkspace"
info Building (using "xcodebuild -workspace reactnative.xcworkspace -configuration Debug -scheme reactnative -destination id=DAB468CB-5D35-49F6-8B17-048E4AC1E455")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactnative.xcworkspace. Run CLI with --verbose flag for more details.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace reactnative.xcworkspace -configuration Debug -scheme reactnative -destination id=DAB468CB-5D35-49F6-8B17-048E4AC1E455

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
error: /Users/trivikr/workspace/aws-sdk-js-tests/packages/react-native/ios/Pods/Target Support Files/Pods-reactnative/Pods-reactnative.debug.xcconfig: unable to open file (in target "reactnative" in project "reactnative") (in target 'reactnative' from project 'reactnative')
error: /Users/trivikr/workspace/aws-sdk-js-tests/packages/react-native/ios/Pods/Target Support Files/Pods-reactnative/Pods-reactnative.debug.xcconfig: unable to open file (in target "reactnative" in project "reactnative") (in target 'reactnative' from project 'reactnative')
error: /Users/trivikr/workspace/aws-sdk-js-tests/packages/react-native/ios/Pods/Target Support Files/Pods-reactnative/Pods-reactnative.debug.xcconfig: unable to open file (in target "reactnative" in project "reactnative") (in target 'reactnative' from project 'reactnative')
error: /Users/trivikr/workspace/aws-sdk-js-tests/packages/react-native/ios/Pods/Target Support Files/Pods-reactnative/Pods-reactnative.debug.xcconfig: unable to open file (in target "reactnative" in project "reactnative") (in target 'reactnative' from project 'reactnative')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the reactnative editor. (in target 'reactnative' from project 'reactnative')


** BUILD FAILED **


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce
Follow README steps for iOS https://github.com/aws-samples/aws-sdk-js-tests#ios

Expected behavior
React Native iOS build succeeds, and project is opened in iOS simulator.

Probably related to #57 where the folder reactnative was renamed to react-native

The error unable to open file (in target "reactnative" in project "reactnative") is thrown as pod install step needs to be run in ios folder, before React Native iOS build is run.

One solution is to commit iOS Pods as discussed in https://www.reddit.com/r/reactnative/comments/d2lt07/commiting_ios_pods/

However, Pods folder is added to .gitignore by default. This suggests that pods should be installed on dev's machine.
Running pod install before running iOS build is a better solution.

@trivikr running pod install inside the ios folder solved my issues. Hopefully React-native team will put this on their official documentation.
Thanks again!

I love u all!
I had the same issue on Mac, installing a react-native 0.60 and node 10.24.1 project builded and published on 2019, and nobody made maintenance...
be sure to install cocoa pods
$ gem uninstall cocoapods
$ gem install cocoapods
And then you can install in ios project folder with pod install