Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New React-Native Project: Build fails (ios)

I'm using: react-native-cli: 2.0.1 react-native: 0.62.2 Xcode: 11.3.1

Creating a react-native project (react-native init GetAway) and starting it with npx react-native run-ios throws an build error:

The following build commands failed:
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal x86_64 /Users/sercan/Desktop/Arbeit/Urlaub/rescue/GetAway/ios/Pods/YogaKit/YogaKit/Source/YGLayoutExtensions.swift
(2 failures)

I have no clue, why it comes to an build error, to a new created project. If you have any ideas to solve this problem, please let me know.

Thanks in Advance

Edit: Link for full error message: https://docs.google.com/document/d/1o6tj9OrWmH-OZ5rCkYxhQTi-RYH36S5u36zpmBHHY3E/edit?usp=sharing

like image 592
Sercan Samet Savran Avatar asked Apr 27 '20 18:04

Sercan Samet Savran


People also ask

Can you build iOS apps with React Native?

React Native enables you to use React to build mobile apps that work on both Android and iOS. In this tutorial, we’ll demonstrate how to build iOS apps using React Native. What is React Native? React Native enables you to write Android and iOS apps using JavaScript.

What is a React Native component?

A React Native component is very similar to a React component. All React APIs are also available in React Native. Let’s create a simple increment button to better understand React Native APIs: All the React Hooks are usable in React Native. Communication with external services is very important for any application.

What is logrocket in React Native?

LogRocket: Instantly recreate issues in your React Native apps. LogRocket is a React Native monitoring solution that helps you reproduce issues instantly, prioritize bugs, and understand performance in your React Native apps.


Video Answer


3 Answers

In my macOS system, this build error was resolved by restarting the computer. The issue has been reported at https://github.com/facebook/react-native/issues/28777, where I also found this workaround.

like image 52
Lauri Harpf Avatar answered Nov 13 '22 02:11

Lauri Harpf


I resolved this by uninstalling the globally installed react-native-cli. The react-native environment setup docs also state this.

React Native Environment Setup Docs

Screenshot from the environment setup docs

like image 24
Himanshu Tiwari Avatar answered Nov 13 '22 02:11

Himanshu Tiwari


i fixed something similar by updating my xcode to 13 which requires that you update your macos to 11

like image 31
Phap Dinh Avatar answered Nov 13 '22 01:11

Phap Dinh