Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.97k stars 1.11k forks source link

Build Failed while running Xcode #1151

Open ansrthy opened 5 months ago

ansrthy commented 5 months ago

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.

andyb-unity commented 5 months ago

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.

ansrthy commented 5 months ago

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?

imamura-mmj commented 5 months ago

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.

andyb-unity commented 5 months ago

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 commented 5 months ago

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.

ansrthy commented 5 months ago

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?

andyb-unity commented 5 months ago

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.

ansrthy commented 5 months ago

Thank you for responding so quickly.

r618 commented 5 months ago

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 ?

andyb-unity commented 5 months ago

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.

ansrthy commented 5 months ago

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?

imamura-mmj commented 4 months ago

The following worked on my M2 Mac.

ansrthy commented 4 months ago

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 commented 4 months ago

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.

andyb-unity commented 4 months ago

@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.

ansrthy commented 4 months ago

@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!

artfail commented 3 months ago

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_referenceImagesInGroupNamedbundle, you get the idea) I am using 2023.2.15 on an M1 mac.

andyb-unity commented 3 months ago

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

ansrthy commented 3 months ago

@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?