arcore-unity-extensions icon indicating copy to clipboard operation
arcore-unity-extensions copied to clipboard

iOS Crashing on UnityWebRequestAssetBundle.GetAssetBundle if ARCore Extensions included

Open Barokoli opened this issue 2 years ago • 2 comments

Our published App stopped working on Monday seemingly out of nowhere. Before that we had no trouble, the published app was online for a couple of days and worked as expected.

I did some investigations that i go into more detail in my post to the Unity forums. (https://forum.unity.com/threads/ios-crashing-on-assetbundle-load.1509404/) I also created a Unity Bug Report since the crash happens on the Unity side. In short from my testing following criteria produce a crash:

  1. Call UnityWebRequestAssetBundle.GetAssetBundle(url).SendWebRequest(); with a valid url that hosts any unity built bundle.
  2. The project needs to contain following Pods:
platform :ios, '12.0'
 
target 'UnityFramework' do
  pod 'ARCore/CloudAnchors', '~> 1.35.0'
  pod 'ARCore/GARSession', '~> 1.35.0'
  pod 'ARCore/Geospatial', '~> 1.35.0'
  pod 'Firebase/Auth', '9.6.0'
  pod 'Firebase/Core', '9.6.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static

It will crash once the bundle download finished.

I think the firebase pod is not necessary since the extensions already depend on it.

My testing config: Build on Macbook M1 XCode 15.0.1 <- might be important Target device: IpadOS 16.7.1 IPad Pro 12.9 4th Gen

Barokoli avatar Oct 26 '23 14:10 Barokoli

In the Unity Forum linjianfei found a workaround. It is possible to add "-ld64" to the linker flags to circumvent the issue.

Barokoli avatar Oct 30 '23 09:10 Barokoli

I had this issue too and the linker flag worked for me. Let me leave where to put the "-ld64" flag in Xcode. [Build Settings] > [UnityFramework] > [Other Linker Flags]

Thank you for finding the solution. It saved my life.

Screenshot 2024-05-05 at 1 44 39

Xcode: 15.2 Unity: 2023.3.26f1 ARCore Extensions: 1.42.0 I'm using AR Foundation 5.1.4

ku6ryo avatar May 04 '24 16:05 ku6ryo