Fresh react-native (0.66) app does not build on XCode 13, iOS 11.6: compiler error on SysUio.o
  • 01-May-2023
Lightrun Team
Author Lightrun Team
Share
Fresh react-native (0.66) app does not build on XCode 13, iOS 11.6: compiler error on SysUio.o

Fresh react-native (0.66) app does not build on XCode 13, iOS 11.6: compiler error on SysUio.o

Lightrun Team
Lightrun Team
01-May-2023

Explanation of the problem

Upon running the command “yarn ios”, the error message “Failed to build iOS project” is displayed, indicating that the build process was unsuccessful. The error code 65 returned by “xcodebuild” is an indication that there is a problem with the build configuration or the project setup. In order to obtain more detailed build logs for debugging purposes, it is suggested to try building the app using Xcode.app and opening the test.xcworkspace file.

The error message further provides details of the build configuration that was used, including the Xcode workspace, the build system used (new build system), and the build target. Additionally, it provides a summary of the build preparation process, which includes analyzing the workspace, creating a build description, and preparing the targets for building in parallel.

Troubleshooting with the Lightrun Developer Observability Platform

Getting a sense of what’s actually happening inside a live application is a frustrating experience, one that relies mostly on querying and observing whatever logs were written during development.
Lightrun is a Developer Observability Platform, allowing developers to add telemetry to live applications in real-time, on-demand, and right from the IDE.

  • Instantly add logs to, set metrics in, and take snapshots of live applications
  • Insights delivered straight to your IDE or CLI
  • Works where you do: dev, QA, staging, CI/CD, and production

Start for free today

Problem solution for Fresh react-native (0.66) app does not build on XCode 13, iOS 11.6: compiler error on SysUio.o

The issue at hand is related to a change in the react-native-gesture-handler library. Previously, it was required to import the library at the top of the root file, but now it must be imported in App.js instead. This change may cause the error “Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable.” to occur. To fix this, developers should import the library in App.js and wrap the app with GestureHandlerRootView. The code for this looks like the following:

import { GestureHandlerRootView } from 'react-native-gesture-handler';
/* ... */
// Wrap your app with the new GestureHandler
<GestureHandlerRootView style={{ flex: 1 }}>
  /* your app */
</GestureHandlerRootView>

Additionally, it’s recommended to install the pods using “npx pod-install ios” after creating the project. This command installs the required CocoaPods dependencies for the iOS platform. It’s important to note that using node versions 12 or 14 is recommended, as there may be compatibility issues with newer versions. Finally, when launching the app, it’s recommended to use “npx react-native run-ios” instead of “yarn ios”. This ensures that the app is launched correctly and can help avoid any issues related to running the app from the terminal.

In conclusion, this error is related to a change in the way react-native-gesture-handler is imported, which can lead to compatibility issues with newer versions of React Native. The recommended solution is to import the library in App.js and wrap the app with GestureHandlerRootView. Additionally, installing the required CocoaPods dependencies using “npx pod-install ios” and using node versions 12 or 14 are recommended. Finally, launching the app using “npx react-native run-ios” is recommended to avoid any issues related to running the app from the terminal.

Other popular problems with React

Problem: Virtual DOM performance issues

One of the most common problems with React is related to performance issues with the virtual DOM. The virtual DOM is a mechanism that React uses to update the view in response to changes in the underlying data. When the state of a component changes, React will first update the virtual DOM, and then update the actual DOM. This process can be slow, particularly if the component has a large number of child elements.

Solution:

To solve this problem, developers can use techniques such as shouldComponentUpdate, which allows components to control when they should re-render, or use the React.memo higher-order component, which only re-renders a component when its props change. Additionally, developers can use the React DevTools extension to identify and optimize components that are causing performance bottlenecks.

Problem: Managing state and props

Another common problem with React is related to managing state and props. React components can have both state and props, which are used to store and pass data between components. However, when a large number of components need to share and update data, it can become difficult to manage and maintain the flow of data.

Solution:

To solve this problem, developers can use a centralized state management library such as Redux or MobX. These libraries allow developers to store all of the application’s state in a single place, and provide a mechanism for updating and sharing that state across all components. Additionally, developers can use the useContext and useReducer hooks to manage state within a component tree.

Problem: Handling Forms

React forms can also be a source of pain for developers, as they require a lot of boilerplate code to handle changes and validation. Forms can be tricky to handle because they often involve multiple inputs, which need to be controlled and updated correctly.

Solution:

To solve this problem, developers can use libraries such as Formik and react-hook-form to handle forms in React. These libraries provide simple APIs for controlling form inputs and handling validation. Additionally, developers can use the useState and useEffect hooks to handle form input changes and validation manually.

A brief introduction to React

React is a JavaScript library for building user interfaces. It was developed by Facebook and is now maintained by a community of developers. React allows developers to build reusable UI components, which can be composed to create complex user interfaces. React uses a virtual DOM (Document Object Model) to improve performance by limiting the amount of changes that need to be made to the actual DOM. The virtual DOM is a lightweight representation of the actual DOM and it allows React to compare the current state of the virtual DOM with the previous state, and make only the necessary changes to the actual DOM.

React follows a component-based architecture, where the user interface is broken down into small, self-contained components that can be easily reused and composed to create more complex UI. React components can have both state and props, which are used to store and pass data between components. React also provides a mechanism for handling events, such as user clicks, through the use of event handlers. React also provides a set of lifecycle methods that developers can use to control when a component is created, updated, and destroyed. This allows developers to control the behavior of their components and optimize performance.

Most popular use cases for React

  1. Building reusable UI components React allows developers to build reusable UI components that can be composed to create complex user interfaces. Each component is self-contained and can manage its own state and props. This allows developers to easily reuse and maintain their code.
  2. Dynamic User Interfaces React uses a virtual DOM to improve performance by limiting the amount of changes that need to be made to the actual DOM. This allows developers to build dynamic user interfaces that can efficiently update in response to changes in the underlying data.
  3. Building complex web applications React can be used to build complex web applications that require efficient updating of dynamic data. React also provides a set of lifecycle methods that developers can use to control when a component is created, updated, and destroyed. This allows developers to control the behavior of their components and optimize performance.
class Counter extends React.Component {
  constructor(props) {
    super(props);
    this.state = { count: 0 };
  }

  handleClick = () => {
    this.setState({ count: this.state.count + 1 });
  }

  render() {
    return (
      <div>
        <p>Count: {this.state.count}</p>
        <button onClick={this.handleClick}>
          Increment
        </button>
      </div>
    );
  }
}
Share

It’s Really not that Complicated.

You can actually understand what’s going on inside your live applications.

Try Lightrun’s Playground

Lets Talk!

Looking for more information about Lightrun and debugging?
We’d love to hear from you!
Drop us a line and we’ll get back to you shortly.

By submitting this form, I agree to Lightrun’s Privacy Policy and Terms of Use.