Skip to content
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

Unable to run AwesomeProject sample app successfully with error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. #24450

Closed
jerrychong25 opened this issue Apr 15, 2019 · 74 comments
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@jerrychong25
Copy link

🐛 Bug Report

To Reproduce

  1. Open Getting Started for macOS iOS.
  2. Follow all dependencies installation steps
  3. Create a new application via command:
    react-native init AwesomeProject
  4. Run AwesomeProject via command:
cd AwesomeProject
react-native run-ios
  1. Error occured when running project:
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 a
pp with Xcode.app, by opening AwesomeProject.xcodeproj
  1. Run sample app failed.

Expected Behavior

Run sample app successfully.

Code Example

Run new project named AwesomeProject as mentioned in Getting Started for macOS iOS.

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
      Memory: 190.08 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.14.0 - /usr/local/bin/node
      npm: 6.7.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-23 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, andr
oid-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5314842
      Xcode: 10.2/10E125 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.4 => 0.59.4 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Debug Log

macusers-MacBook:AwesomeProject HighSierra$ react-native run-ios
info Found Xcode project AwesomeProject.xcodeproj
info Launching iPhone X (iOS 12.2)...
info Building using "xcodebuild -project AwesomeProject.xcodeproj -configuration Debug -scheme AwesomeProject -destination id=274D552C-C67B-4EFA-A90C-
AF559D0954F0 -derivedDataPath build/AwesomeProject"
info User defaults from command line:

info     IDEDerivedDataPathOverride = /Users/HighSierra/Documents/GitHub/AwesomeProject/ios/build/AwesomeProject


info Build Preparation

info Couldn't create workspace arena folder '/Users/HighSierra/Documents/GitHub/AwesomeProject/ios/build/AwesomeProject': Unable to write to info file
 '<DVTFilePath:0x7f9358f7b8d0:'/Users/HighSierra/Documents/GitHub/AwesomeProject/ios/build/AwesomeProject/info.plist'>'.

info 

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 a
pp with Xcode.app, by opening AwesomeProject.xcodeproj

2019-04-15 11:50:32.423 xcodebuild[30913:229065] Error saving log: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSFilePath=/U
sers/HighSierra/Documents/GitHub/AwesomeProject/ios/build/AwesomeProject/Logs/Build/09631BCB-251C-4C0A-8A81-7451C031D0B5.xcactivitylog, NSLocalizedDes
cription=Permission denied} | User info: {
    NSFilePath = "/Users/HighSierra/Documents/GitHub/AwesomeProject/ios/build/AwesomeProject/Logs/Build/09631BCB-251C-4C0A-8A81-7451C031D0B5.xcactivit
ylog";
    NSLocalizedDescription = "Permission denied";
}
** BUILD FAILED **

. Run CLI with --verbose flag for more details.

Could anyone assist on this issue?

Thanks.

@kamilzamerski
Copy link

kamilzamerski commented Apr 15, 2019

The same after update xcode ...
Solution for me was to delete 2 "gray" elements problem from Libraries and rebuild project.

@saxenanickk
Copy link
Contributor

@jerrychong25 Hey! I can provide a temporary workaround for your problem. Follow these steps:

File -> Workspace Settings -> Build System -> Legacy Build System

@alvin-toffler
Copy link

The same after update xcode ...
Solution for me was to delete 2 "gray" elements problem from Libraries and rebuild project.

@kamilzamerski Can you elaborate?

@kamilzamerski
Copy link

@alvin-toffler
After update XCode i've got that problem with build project. I've discovered that in XCode project in Libraries directory i have 2 bad linked libs (gray icon against blue and without posibility to extend arrow).
I deleted it from the project and once again do a react-native link. And now it's work properly.

Zrzut ekranu 2019-04-17 o 11 02 06

@nolan12345
Copy link

File -> Shared Project Settings -> Build System -> Legacy Build System

@Piero87
Copy link

Piero87 commented May 20, 2019

Yesterday react-native run-ios works with no problem and today I get the error of this issue and haven't change or update anything, any solution?

@carlosbonilla
Copy link

@Piero87 I had exactly the same problem, I just delete the build folder inside /ios then just run again react-native run-ios and the error disappear.

@niclin
Copy link

niclin commented May 22, 2019

I just try sudo react-native run-ios the error disappear.

@HughBerryman
Copy link

HughBerryman commented May 23, 2019

I was getting this same error with regards to the Info.plist. None of the above worked for me - what did was removing <key>NSAllowsArbitraryLoads</key> in Info.plist which was git diffed and added in RN 0.59.8 when I did the manual upgrade. Once I removed that line, everything complied and I was good to go.

@wannyphy
Copy link

wannyphy commented Jun 3, 2019

I found a solution if someone has a problem and you have to create a new folder in document on the command line and it works the reason remains a mystery but after a while I tried everything well that one logically if not at the end of the chips I would never have tested it...

@levelingup
Copy link

@Piero87 I had exactly the same problem, I just delete the build folder inside /ios then just run again react-native run-ios and the error disappear.

This should be the answer

@titoleru
Copy link

@Piero87 I had exactly the same problem, I just delete the build folder inside /ios then just run again react-native run-ios and the error disappear.

I tried this and it worked... Thanks!

@raphaelpinel
Copy link

@Piero87 I had exactly the same problem, I just delete the build folder inside /ios then just run again react-native run-ios and the error disappear.

This should be the answer

This was the answer for me too!

@hramos
Copy link
Contributor

hramos commented Jun 18, 2019

The original author hasn't commented recently, and the template is already tested as part of our CI system, so this shouldn't be a problem on master right now. If anyone runs into a similar problem, please submit a new issue.

@hramos hramos closed this as completed Jun 18, 2019
@akashrauniyar35

This comment has been minimized.

@jerrychong25
Copy link
Author

The original author hasn't commented recently, and the template is already tested as part of our CI system, so this shouldn't be a problem on master right now. If anyone runs into a similar problem, please submit a new issue.

Noted and thanks.

@joelwembo
Copy link

I deleted the build folder inside the ios and run the react-native run-ios, It Worked

@BobsonTheFirst
Copy link

This error occurred when I opened my project for the first time in XCode cuz i needed to add a library. Deleting the build folder in the ios folder alone didn't work for me.

What worked for me:

  • In XCode set "Build System" to "Legacy Build System" (File -> Project Settings -> Build System -> Legacy Build System)
  • Delete the "build" folder in the "ios" folder
  • npm install (I also deleted my node_modules, cuz was installing a new library)
  • react-native run-ios

@eugeneFr9
Copy link

None of mentioned above has worked for me. I just created new project and can not run it...

@veller
Copy link

veller commented Jul 4, 2019

None of these is working for me either. Why is this even closed?

@vatsalyaagarwal
Copy link

None of these is working for me either. Why is this even closed?

downgrade to [email protected], only thing that worked for me.

@ilyasKerbal
Copy link

Same issue
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 TestProject.xcworkspace. Run CLI with --verbose flag for more details. User defaults from command line: IDEDerivedDataPathOverride

@claudiolcastro
Copy link

Same issue here.

react-native-cli: 2.0.1
react-native: 0.60.0
xcode: 10.2.1

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 MyApp.xcworkspace. Run CLI with --verbose flag for more details

@claudiolcastro
Copy link

claudiolcastro commented Jul 11, 2019

so far... with those configs above, the only thing that worked for me was creating a new projet with react-native version 0.59.5 (and reset cache react-native start --reset-cache)

react-native init MyApp --version 0.59.5

@zexingguo
Copy link

^ Same issue!

@Wan-Codes
Copy link

Eu tentei todas as opções acima e ainda assim, nada funciona. Tudo estava bem até que eu atualizei meu sistema operacional hoje (atualização de 30 min).

Atualização: excluí o arquivo AwesomeProject e inicializei um novo e a compilação foi bem-sucedida. No entanto, agora recebo uma mensagem no simulador dizendo "não foi possível conectar ao servidor de desenvolvimento"
Captura de tela 2019-07-31 em 1 48 36 PM

Atualização 2 : excluir a pasta de compilação funcionada, voltando a ver a tela "Bem-vindo ao reagir no simulador do iPhone"

Comigo foi assim também, mas e so dar um ( command + R ) pra resetar a conexão

@Henry23
Copy link

Henry23 commented Oct 18, 2019

@Piero87 I had exactly the same problem, I just delete the build folder inside /ios then just run again react-native run-ios and the error disappear.

Thanks

@mohmdalfaha
Copy link

Literally, not even a single one could fix the issue. I tried all the suggestions. The only solution I might need to do is formatting my whole mac with a clean installation of all tools.

@phuongthuan
Copy link

If you don't have cocoa pods installed you need to sudo gem install cocoapods

  1. cd /ios
  2. run pod install
  3. cd ..
  4. delete build folder
  5. run react-native run-ios

if error persists,

  1. delete build folder again
  2. open the /ios folder in x-code
  3. navigate File -> Project Settings -> Build System -> change (Shared workspace settings and Per-User workspace settings): Build System -> Legacy Build System

It's working. Thank you

@garshen
Copy link

garshen commented Nov 5, 2019

This error occurred when I opened my project for the first time in XCode cuz i needed to add a library. Deleting the build folder in the ios folder alone didn't work for me.

What worked for me:

  • In XCode set "Build System" to "Legacy Build System" (File -> Project Settings -> Build System -> Legacy Build System)
  • Delete the "build" folder in the "ios" folder
  • npm install (I also deleted my node_modules, cuz was installing a new library)
  • react-native run-ios

Perfect it worked for me,,Thanks

@anandaneesh
Copy link

This worked for me!

     react-native start --reset-cache
     rm -rf node_modules/
     rm -rf package-lock.json 
     cd ios
     pod deintegrate
     cd ..
     rm -rf ios/Podfile.lock 
     npm install
     npm audit fix
     react-native link
     cd ios
     pod install
     cd ..
     react-native run-ios

@nihp
Copy link

nihp commented Nov 25, 2019

@phuongthuan @garshen Your solution not worked for me

@thiagosrib
Copy link

Nothing above worked for me. Only worked when I include --scheme param in react-native run-ios

react-native run-ios --scheme "xxxx"

@nihp
Copy link

nihp commented Nov 27, 2019

@thiagosrib How can you set the scheme param. I also facing the same error.

Can you brief me about scheme param?

@thiagosrib
Copy link

@nihp in my case, the project that I work has two schemes in Xcode (Dev and Prod).

So, I used the command below and it worked for me

react-native run-ios --scheme "Dev" or react-native run-ios --scheme "Prod"

@Asrover
Copy link

Asrover commented Dec 1, 2019

  1. sudo gem install cocoapods
  2. cd ios (Folder in your react-native project)
  3. pod install
  4. Restart XCode
  5. react-native run-ios

@nanadjei
Copy link

nanadjei commented Dec 2, 2019

#24450 (comment)

Solution here 👆

@thiagosrib
Copy link

@nihp to create schemes, on Xcode goes to Product -> Schemes -> Manage Schemes... -> (Plus icon to create new scheme).

After create a new scheme, you can manage the configurations chosing Edit option.

Sorry for the delay in my answer.

@nihp
Copy link

nihp commented Dec 3, 2019

Can anyone of you confirm after upgrading how your Header Seach Paths are? Is it like (${PODS_ROOT}/Headers/Public/BugsnagReactNative") Or ($RCTROOT/filename).

What is the correct one after upgrade to 0.60.0 or 0.61.5

@LAITONEN
Copy link
Contributor

Ok, I got it. Had issues setting-up a new project after not using React-Native for a lot of time.

My system:

macOS High Sierra 10.13.6
XCode 9.4
Had to reinstall the project in order to use the installation guide from version 0.59.0, because the installation guide from 0.61 uses approach with npx react-native ..., which disallows the usage of react-native below 0.60 (quite totalitarian). 0.59.0 was still using the global version of react-native installed through npm.

In other words:
Reinstall the project by removing the old one and use the steps mentioned in the "Getting Started" guide of React-Native 0.59.0 (or any other version compatible with your version of OS and XCode) to install your project again. No need to delete any build or node_modules or installing pods again and so forth, just pick the version of React-Native compatible with your macOS and Xcode (by downgrading and reinstalling the project until you get it) and no need to upgrade to the latest versions, they are developed for the latest systems, if you don't want to buy the latest devices to support the latest software (OS) or you can't afford them, just stay with the old ones - it's totally fine :)

@congtrieu112
Copy link

should be remove build folder in folder ios and run again, I work good

@anastely
Copy link

anastely commented Feb 9, 2020

I did every single thing above but still the issues, I can't build my ios app :(

@Khushboo-gupta-123
Copy link

when i run my react-native project on terminal for ios i faced this issue??is there any solution i tried everything but i can't run my app and my xcode not working when i open my project.
"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 demo.xcworkspace"

@DeadDuck83
Copy link

@Khushboo-gupta-123 I got the same result. I know this is not the solution you are looking for, but what worked for me was deleting my Node Modules and then Yarn them back and if-so fact-o, it worked. Not a fix, but it worked for me.

  1. Delete node_modules
  2. Yarn to re-install them.

@GuilhermeTrivilin
Copy link

What worked for me was to rename the project by removing the special characters.

Example: "project_marketplace" to "projectmarketplace"

In this case, I redid the project with react-native init and copied the src and package.json folder.

@pereligins
Copy link

Hi All!
I have updated Xcode to 11.4.
It solves this problem for me.

@meetajhu
Copy link

meetajhu commented May 2, 2020

This happens when you terminate the metro bundler terminal window. So make sure you start the metro bundler again by running

npx react-native start

then open your iOS project in Xcode Goto -> Product -> Clean build folder. Then goto your terminal project path start again

npm react-native run-ios

Hope it helps

@facebook facebook locked as resolved and limited conversation to collaborators Jun 18, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests