arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

Build Failed while running Xcode

Open ansrthy opened this issue 2 years ago • 21 comments

Encountering two problems: 1. Undefined symbols, 2. Linker command failed with exit code 1. I'm using simulators to execute the project; could this be causing the issues? Seeking assistance to resolve these issues.

ansrthy avatar Jan 08 '24 09:01 ansrthy

Apple does not support ARKit in the iOS Simulator. It's impossible to run ARKit apps in the simulator, so this is expected to fail.

andyb-unity avatar Jan 08 '24 19:01 andyb-unity

Thank you for the information. Can I use an iPad instead of an iPhone, and are there any specific configurations, such as the iOS version and XCode version, that I need to consider?

ansrthy avatar Jan 10 '24 09:01 ansrthy

I also encountered the same issue. The build for the real device fails with the error mentioned above.

The versions I'm using are as follows: MacBook Pro M2 Venture 13.5 Unity: 2023.2.2f1 Apple Silicon XCode: 15.2

I just opened the cloned repo with a freshly installed Unity 2023.2.2f1, then build it.

imamura-mmj avatar Jan 19 '24 06:01 imamura-mmj

We have reproduced the linker error on Xcode 15.2 with Apple Silicon. We're not sure why yet, but investigation has begun.

andyb-unity avatar Jan 23 '24 19:01 andyb-unity

Ok after our team has looked at this, it appears that the issue is that Apple has broken forward compatibility in Xcode 15.2 with binaries that were compiled on Xcode 14.3. Our next patch release of 6.0 will contain recompiled binaries on a newer version of Xcode, and this is no longer a problem.

For now the recommendation is to use an older version of Xcode. We haven't seen this issue reported on 15.1 or 15.0.

andyb-unity avatar Jan 23 '24 20:01 andyb-unity

Thank you for the information.... I'm using macOS Sonoma 14.2.1 (Intel Core i3) and Xcode version 15.2. I'm encountering a problem again. Is this version also having problems, or is it only for Silicon?

ansrthy avatar Jan 24 '24 09:01 ansrthy

We didn't test this build with an Intel Mac on Xcode 15.2, but I think it's safe to assume that this is an Xcode 15.2 issue. Same instructions apply for Intel most likely.

andyb-unity avatar Jan 24 '24 18:01 andyb-unity

Thank you for responding so quickly.

ansrthy avatar Jan 25 '24 04:01 ansrthy

Ok after our team has looked at this, it appears that the issue is that Apple has broken forward compatibility in Xcode 15.2 with binaries that were compiled on Xcode 14.3. Our next patch release of 6.0 will contain recompiled binaries on a newer version of Xcode, and this is no longer a problem.

For now the recommendation is to use an older version of Xcode. We haven't seen this issue reported on 15.1 or 15.0.

is it correct to assume this will(should) be 6.0.0-pre.6 ?

r618 avatar Jan 25 '24 08:01 r618

is it correct to assume this will(should) be 6.0.0-pre.6 ?

The next release of 6.0 is actually likely going to be 6.0.0. We are preparing to bring the package out of pre-release.

andyb-unity avatar Jan 27 '24 07:01 andyb-unity

We didn't test this build with an Intel Mac on Xcode 15.2, but I think it's safe to assume that this is an Xcode 15.2 issue. Same instructions apply for Intel most likely.

I tried the steps on an Intel-based Mac running Xcode 15.0.1, but encountered the same problems(1. Undefined symbols, 2. Linker command failed with exit code 1). Is there an issue specific to Intel Macs, or is there an alternative solution available?

ansrthy avatar Jan 29 '24 06:01 ansrthy

The following worked on my M2 Mac.

  • Install Xcode 15.0.1. xcode-select if you install it at different location
  • Download v5.0.6 zip file, instead of cloning latest git repo
  • Install Unity 2022.3.18f1 instead of the version specified by the repo (older version of Unity has another issue with xcode 15)
  • Start Unity
  • In the Build Setting > iOS > "Run in Xcode", make sure the right Xcode installation is specified if you have multiple Xcode installs
  • Build it on Unity
  • Open the xcodeproject by XCode and make sure Xcode 15.0.1 is used

imamura-mmj avatar Feb 05 '24 05:02 imamura-mmj

The following worked on my M2 Mac.

  • Install Xcode 15.0.1. xcode-select if you install it at different location
  • Download v5.0.6 zip file, instead of cloning latest git repo
  • Install Unity 2022.3.18f1 instead of the version specified by the repo (older version of Unity has another issue with xcode 15)
  • Start Unity
  • In the Build Setting > iOS > "Run in Xcode", make sure the right Xcode installation is specified if you have multiple Xcode installs
  • Build it on Unity
  • Open the xcodeproject by XCode and make sure Xcode 15.0.1 is used

Thank you so much! Let me give it a try.

ansrthy avatar Feb 05 '24 06:02 ansrthy

I tried, but it shows version problems.

The following worked on my M2 Mac.

  • Install Xcode 15.0.1. xcode-select if you install it at different location
  • Download v5.0.6 zip file, instead of cloning latest git repo
  • Install Unity 2022.3.18f1 instead of the version specified by the repo (older version of Unity has another issue with xcode 15)
  • Start Unity
  • In the Build Setting > iOS > "Run in Xcode", make sure the right Xcode installation is specified if you have multiple Xcode installs
  • Build it on Unity
  • Open the xcodeproject by XCode and make sure Xcode 15.0.1 is used

Thank you so much! Let me give it a try.

ansrthy avatar Feb 06 '24 06:02 ansrthy

@ansrthy We just released 6.0.0-pre.6. Let us know how it goes for you. Note that we have changed the minimum Unity version of AR Foundation 6 from 2023.2 to 2023.3 due to significant changes in URP and plugin serialization in 2023.3 that are not backwards-compatible.

andyb-unity avatar Feb 15 '24 05:02 andyb-unity

@andyb-unity Yes , it worked for me. Thank you so much for sharing such valuable content on AR Foundation With Unity3d! and also for being so quick to respond and support . Your dedication to helping us learn is truly appreciated!. Keep up the great work!

ansrthy avatar Feb 15 '24 07:02 ansrthy

It might be a similar issue. I am using xcode 15.3. I cannot build this demo to my iphone. I basically get 100 Undefined symbol errors (Undefined symbol: _ARReferenceImage_class, Undefined symbol: ARReferenceImage_referenceImagesInGroupNamed_bundle, you get the idea) I am using 2023.2.15 on an M1 mac.

artfail avatar Mar 23 '24 06:03 artfail

@artfail The main branch of this repo is not compatible with Unity 2023.2. You must use 2023.3 (Unity 6) or newer.

andyb-unity avatar Mar 25 '24 13:03 andyb-unity

@andyb-unity I have tried to add new 3D models of lungs and brains created using 3D Slicer, etc., into Unity, but they're not importing properly. Can you suggest any solutions? Also, instead of tracking whole body using a robot, can we track specific parts of the body like hands and legs?

ansrthy avatar Mar 26 '24 08:03 ansrthy

I have exactly the same bunch of undefined symbols (_ARReferenceImage_class etc), Unity 6000.1.3f1 Xcode 16.4, ARFoundation 6.1.1

Rolling back to xcode 15.0 and Unity 2022 as described above is not an option for us.

TonyHoyle avatar Jul 11 '25 15:07 TonyHoyle

@TonyHoyle If you want a Unity staff member to investigate, please file an official bug: https://unity.com/releases/editor/qa#bug-reporting

GitHub issues are unofficial, and you may not get a response from the team. Note that we test our releases of this repo on every release, and we don't have any problems with Xcode.

andyb-unity avatar Jul 11 '25 15:07 andyb-unity

Closing this issue due to inactivity. Please file any future bugs using Unity's official bug reporting process: https://unity3d.com/unity/qa/bug-reporting

andyb-unity avatar Dec 16 '25 22:12 andyb-unity