Undefined symbols for architecture arm64
  • 27-Apr-2023
Lightrun Team
Author Lightrun Team
Share
Undefined symbols for architecture arm64

Undefined symbols for architecture arm64:

Lightrun Team
Lightrun Team
27-Apr-2023

Explanation of the problem

The linker error message displays the undefined symbols for the arm64 architecture, including ARAnchor, ARImageAnchor, AROrientationTrackingConfiguration, ARPlaneAnchor, ARReferenceImage, ARSession, and ARWorldTrackingConfiguration classes. Additionally, the error reports a Geo function issue, GetiOSAppDocumentsDir(), referenced from PathUtils::GetSandboxDataPath().

Troubleshooting Attempts: To resolve the issue, the user attempted to change the architecture from universal to arm64 in the project’s player settings. However, this solution did not resolve the issue.

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 Undefined symbols for architecture arm64:

To resolve the linker error related to ARKit classes in the new project, the user can try adding ARKit’s framework to the Linked Frameworks and Libraries list in the General settings of the project panel. This solution may address the undefined symbols issue related to ARAnchor, ARImageAnchor, AROrientationTrackingConfiguration, ARPlaneAnchor, ARReferenceImage, ARSession, and ARWorldTrackingConfiguration classes.

Another possible solution suggested by a user is to consider using ARFoundation and ARKit XR version 2.1 instead of version 2.2, which requires ios 13 and Xcode 11. This alternative solution may help resolve compatibility issues and allow the package to run successfully in the new project.

Other popular problems with react-native-unity-view

Problem: Unity content does not appear in the React Native application

One common issue that users face is when the Unity content does not appear in the React Native application. This can occur due to a variety of reasons, such as incorrect configuration or rendering issues.

Solution:

To resolve this issue, users should check the following: the correct Unity project is built for the correct platform and that the Unity content is loaded correctly within the Unity project. Additionally, users should ensure that the Unity content is properly rendered by using the onMessage event in React Native. This event is triggered when a message is received from the Unity content, allowing users to confirm that the content is successfully rendered in the React Native application.

Problem: Inconsistent behavior between iOS and Android platforms

Another common issue that users face is when the Unity content behaves inconsistently between the iOS and Android platforms. This can occur due to platform-specific differences, such as differences in rendering and handling of events.

Solution:

To resolve this issue, users should ensure that their implementation is platform-agnostic by utilizing the Unity API’s cross-platform capabilities. Additionally, users should follow best practices when working with platform-specific features, such as ensuring that platform-specific code is properly encapsulated and handling platform-specific events in a platform-agnostic way. Users can also take advantage of platform-specific libraries, such as React Native’s Platform module, to handle platform-specific differences in a more robust and reliable manner.

Problem: Performance issues when rendering Unity content in React Native

The final common issue that users face is performance issues when rendering Unity content in React Native. This can occur due to the complex nature of Unity content and the overhead required to integrate it into React Native applications.

Solution:

To improve performance when rendering Unity content in React Native, users should consider optimizing their Unity project and their React Native application. This can involve reducing the complexity of the Unity content, reducing the number of interactions between the Unity content and React Native, and optimizing the rendering of the Unity content within React Native. Additionally, users should follow best practices for optimizing performance in React Native applications, such as using the FlatList component for large lists of content and utilizing the shouldComponentUpdate lifecycle method to prevent unnecessary rendering. Users can also consider using third-party libraries, such as React Native Fast Refresh or the Hermes JavaScript engine, to improve overall performance and reduce the overhead required for rendering Unity content within React Native.

A brief introduction of react-native-unity-view

React-Native-Unity-View is a library that allows developers to embed Unity3D content in a React Native application. It provides a bridge between the Unity3D engine and React Native, allowing for seamless integration of Unity content with React Native components. The library supports both iOS and Android platforms and offers a range of features such as the ability to pass data between Unity and React Native components and support for touch events. React-Native-Unity-View utilizes native components to render Unity scenes, providing a high level of performance and rendering quality.

React-Native-Unity-View is built on top of the React Native framework, utilizing its native module architecture to bridge the gap between the Unity engine and React Native. It provides an easy-to-use API that allows developers to create Unity scenes within their React Native components. The library is highly configurable, providing a range of options for developers to customize their Unity content, including the ability to define custom events, set up a range of touch inputs, and customize the rendering quality of Unity scenes. React-Native-Unity-View is a powerful tool for developers looking to integrate Unity content into their React Native applications, offering a high level of performance, flexibility, and ease of use.

Most popular use cases for react-native-unity-view

  1. React-Native-Unity-View can be used to create interactive augmented reality (AR) experiences within a React Native application. By leveraging the Unity3D engine, developers can create immersive AR scenes that interact with the real world. This can be achieved by utilizing the device’s camera and sensors to track objects and movement, and rendering 3D models on top of the camera feed. Here’s an example of how to render a Unity scene in a React Native component using the React-Native-Unity-View library:
    import React, { Component } from 'react';
    import { View } from 'react-native';
    import UnityView from 'react-native-unity-view';
    
    class ARScene extends Component {
      render() {
        return (
          <View style={{ flex: 1 }}>
            <UnityView style={{ flex: 1 }} />
          </View>
        );
      }
    }
    
    export default ARScene;

    2. React-Native-Unity-View can be used to create 3D interactive UI elements within a React Native application. By leveraging the Unity3D engine’s powerful rendering capabilities, developers can create complex 3D UI elements that interact with user inputs. This can be achieved by rendering Unity scenes as textures within React Native components and using React Native touch events to control them. Here’s an example of how to pass data between React Native and Unity components using the React-Native-Unity-View library:

    import React, { Component } from 'react';
    import { View } from 'react-native';
    import UnityView from 'react-native-unity-view';
    
    class UIElement extends Component {
      constructor(props) {
        super(props);
    
        this.state = {
          text: 'Hello from React Native!',
        };
    
        this.handleUnityMessage = this.handleUnityMessage.bind(this);
      }
    
      handleUnityMessage(message) {
        const { type, data } = message;
    
        if (type === 'textUpdate') {
          this.setState({ text: data });
        }
      }
    
      render() {
        return (
          <View style={{ flex: 1 }}>
            <UnityView
              style={{ flex: 1 }}
              onMessage={this.handleUnityMessage}
              arEnabled={false}
            />
            <View style={{ position: 'absolute', bottom: 0 }}>
              <Text>{this.state.text}</Text>
            </View>
          </View>
        );
      }
    }
    
    export default UIElement;
    

    3. React-Native-Unity-View can be used to create 3D games within a React Native application. By leveraging the Unity3D engine’s powerful game development capabilities, developers can create complex games that run within React Native components. This can be achieved by rendering Unity scenes within React Native components and using React Native touch events to control gameplay. React-Native-Unity-View also allows for seamless communication between Unity and React Native components, enabling developers to build hybrid games that take advantage of both technologies.

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.