React Native iOS Build - Directory not found for option
NickName:Laura Beatris Ask DateTime:2020-03-30T00:03:04

React Native iOS Build - Directory not found for option

Description

I'm doing the build process of my IOS app with the App Center. But it runs pod install and in the next step it uses .xcodeproj instead of .xcworkspace folder. It gives an error of directory not found.

I would like to know why the error is happening with the .xcodeproj file and not with the .xcworkspace folder and what is that error, that will help me to prevent that happens again with other projects.

React Native version:

0.61.2

Steps

1) The installation of pod dependencies works fine

==============================================================================
Task         : CocoaPods
Description  : Install CocoaPods dependencies for Swift and Objective-C Cocoa projects
Version      : 0.151.1
Author       : Microsoft Corporation
Help         : https://learn.microsoft.com/azure/devops/pipelines/tasks/package/cocoapods
==============================================================================
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
1.7.5
[command]/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update
Updating local specs repositories
....
[!] Please close any current Xcode sessions and use `FastFeet.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 24 dependencies from the Podfile and 25 total pods installed.
The STDIO streams did not close within 10 seconds of the exit event from process '/usr/local/lib/ruby/gems/2.6.0/bin/pod'. This may indicate a child process inherited the STDIO streams and has not yet exited.
##[section]Finishing: Pod install

2) Xcode build step uses sgeo.xcodeproj instead sgeo.xcworkspace and uses. That's why it fails and would to know why.

##[section]Starting: Xcode build (not signed)
==============================================================================
Task         : Xcode
Description  : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
Version      : 4.130.0
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613730)
==============================================================================
[command]/usr/bin/xcodebuild -version
Xcode 10.3
Build version 10G8
##[warning]Output directory for build output (binaries) ignored. Specifying an output directory is incompatible with the 'archive' action.
[command]/usr/bin/xcodebuild -project /Users/vsts/agent/2.155.1/work/1/s/ios/sgeo.xcodeproj -scheme sgeo clean archive -archivePath /Users/vsts/agent/2.155.1/work/1/output/build/archive/sgeo.xcarchive CODE_SIGNING_ALLOWED=NO

...

ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-Core'
ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-DevSupport'

ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-RCTActionSheet'
ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/BuildProductsPath/Release-iphoneos/React-RCTAnimation'

** ARCHIVE FAILED **


The following build commands failed:
    Ld /Users/vsts/Library/Developer/Xcode/DerivedData/sgeo-byybcvsvzaukpqcrnnthwhpvohyi/Build/Intermediates.noindex/ArchiveIntermediates/sgeo/IntermediateBuildFilesPath/sgeo.build/Release-iphoneos/sgeo.build/Objects-normal/arm64/sgeo normal arm64
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
##[section]Finishing: Xcode build (not signed)

Expected Results

App Center Build step needs to detect the .xcworkspace folder instead of .xcodeproj, and uses it to the pod install step.

Snack, code example, screenshot, or link to a repository:

https://ibb.co/jWWVjb2

Copyright Notice:Content Author:「Laura Beatris」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60917018/react-native-ios-build-directory-not-found-for-option

Answers
Laura Beatris 2020-04-09T11:29:58

Well... i found the reason of the error in the App Center Documentation.\n\nIf you configure the App Center automatically via the react-native link, you must open the project's ios/{appname}.xcworkspace file in Xcode. Like App Center dependencies, CocoaPods works only with xcworkspace and not xcodeproj, and the ios /{appname}.xcodeproj file will not have linked App Center CocoaPods dependencies.\n\nAll of this information is provided by the Application Center: https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/react-native#42-build-and-run-your-application-from - xcode-or-android-studio",


More about “React Native iOS Build - Directory not found for option” related questions

React Native iOS Build - Directory not found for option

Description I'm doing the build process of my IOS app with the App Center. But it runs pod install and in the next step it uses .xcodeproj instead of .xcworkspace folder. It gives an error of dire...

Show Detail

ld: warning: directory not found for option with rn0.60

When I try to compile the library folders cannot be found. Occurs both via npm and xcode. I initialised a new project with rn 0.60.0, added my Podfile and Deps. Also I added the workaround for Fir...

Show Detail

React Native can not build and run by Xcode10

New react native project can react-native run-ios to run on device but can not run by xcode 10. It gets the error when I build the project. ld: warning: directory not found for option '-L/Users/v...

Show Detail

react-native 0.60.4 xcode build failed

I create new project with react-native 0.60.4 version. Run react-native run-ios is fine on Simulator. But use Xcode build project will show warning and error . I try to rm -rf node_modules &...

Show Detail

React Native iOS build succeeds locally but fails on CI server

I recently updated a React Native project to version 0.59, and the built-in AsyncStorage is now deprecated. So I installed the @react-native-community/react-native-async-storage package instead as

Show Detail

React Native iOS build succeeds locally but fails on CI server

I recently updated a React Native project to version 0.59, and the built-in AsyncStorage is now deprecated. So I installed the @react-native-community/react-native-async-storage package instead as

Show Detail

Using the Facebook iOS SDK in a CI build - Framework not found

My React Native app makes use of the react-native-fbsdk package, and I am trying to make the iOS build work on a CI server (Azure DevOps). The main problem is that the Facebook SDK is expected to be

Show Detail

Run a React Native iOS release build from terminal

I am trying to run the release build directly from the terminal and I did not found an option to do that. From XCode what is required to do is: Product -> Scheme -> Edit Scheme (cmd + <), m...

Show Detail

React-Native error ld: library not found for -lBVLinearGradient

Installed 'react-native-lienar-gradient' library in my new react-native project. Added pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' in Podfile Performed pod in...

Show Detail

Unable to build react-native iOS build. 'Analytics/SEGAnalytics.h' file not found

Running macOS Mojave and Xcode version 9.4 When I try building my react-native iOS app either on command line or in the Xcode project, it fails with the following error: /Users/padminipyapali/

Show Detail