Skip to content

Undefined symbols error on build iOS Unity project #2318

@stdev33

Description

@stdev33

Goals

Build Unity application for iOS target platform using Realm

Expected Results

Finish build process with no linker errors.

Actual Results

Linker error
Undefined symbols for architecture arm64: "_realm_thread_safe_reference_destroy", referenced from: _ThreadSafeReferenceHandle_Unbind_m8B516E342FFE32FA967A0774363A935962952FCD in Realm1.o _NativeMethods_destroy_realm_reference_m5953D89668770CFD7399888C4CF3FBCC136A591B in Realm1.o ld: symbol(s) not found for architecture arm64

Steps to Reproduce

  1. Create an empty Unity project, switch Build target to iOS;
  2. Import realm.unity.bundle-10.1.2.tgz using Package Manager;
  3. Create sample .cs script that invokes Realm.GetInstance() and uses sample RealmObject. Attach script to any object in the SampleScene.unity;
  4. Export Xcode project (File --> Build Settings... --> Build);
  5. Open Xcode project, setup your Team, Bundle Identifier and Provisioning Profile etc. in Signing & Capabilities tab;
  6. Set Enable Bitcode property to NO for both Unity-iPhone and UnityFramework targets (Build Settings tab --> Build Options);
  7. Try to build Xcode project (Command+B or top menu Product --> Build);
  8. Linker error will be thrown Undefined symbols for architecture arm64: "_realm_thread_safe_reference_destroy", referenced from: _ThreadSafeReferenceHandle_Unbind_m8B516E342FFE32FA967A0774363A935962952FCD in Realm1.o _NativeMethods_destroy_realm_reference_m5953D89668770CFD7399888C4CF3FBCC136A591B in Realm1.o ld: symbol(s) not found for architecture arm64

Code Sample

Version of Realm and Tooling

  • Realm Object Server Version: ? (you can see this as well in Studio once connected to a Realm instance)
  • Flavor:
    • Realm Cloud
    • Self-Hosted
  • Server OS & Version: ? (e.g. CentOS 6)
  • Client SDK Version: realm.unity.bundle-10.1.2
  • Client OS & Version: macOS Catalina 10.15.7
  • Unity 2020.3.2f1 (also reproduced with Unity 2019.4.20f1)
  • Xcode 12.4

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions