Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.05k stars 1.14k forks source link

[Bug]Errors: Failed to initialize subsystem ARKit-Meshing and fopen at build #809

Closed sergiosolorzano closed 3 years ago

sergiosolorzano commented 3 years ago

Unity bug report case number Bug report submitted to Unity with ARF project number 1334601

Describe the bug New Fresh project with Big Sur 11.4 beta, Unity 2020.3.7f1 and open ARF 4.17 from git https://github.com/Unity-Technologies/arfoundation-samples.git as iOS. When the app launches Xcode shows errors: [Subsystems] Loading plugin UnityARKit for subsystem ARKit-Input... [Subsystems] UnityARKit successfully registered Provider for ARKit-Input [Subsystems] Loading plugin UnityARKit for subsystem ARKit-Meshing... [Subsystems] Failed to initialize subsystem ARKit-Meshing [error: 1] New input system (experimental) initialized 2021-05-07 17:43:45.670357+0100[12896:1339705] fopen failed for data file: errno = 2 (No such file or directory) 2021-05-07 17:43:45.670467+0100 [12896:1339705] Errors found! Invalidating cache... 2021-05-07 17:43:46.099092+0100 [12896:1339705] fopen failed for data file: errno = 2 (No such file or directory) 2021-05-07 17:43:46.099196+0100[12896:1339705] Errors found! Invalidating cache... 2021-05-07 17:43:46.497900+0100[12896:1339705] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x115e5a1f0>.

I have found this solution (see below) and the error message for fopen (not the ARKit Meshing error) and the error message no longer showed but I guess that doesn't solve non-working shaders reported here and/or these errors shown to apple when submitting the app for review.

"Metal is one possible culprit. If you're importing Metal, try omitting it to see if the error goes away. Also, edit your scheme diagnostics (command<, then click the Diagnostics tab) and deselect Metal API Validation if it's selected."

To Reproduce

  1. Create New Fresh project with Unity 2020.3.7f1 by opening ARF 4.17 from git https://github.com/Unity-Technologies/arfoundation-samples.git as iOS
  2. Untick in project settings ARKit Face tracking.
  3. Remove ARKit Face Tracking in Package manager
  4. Remove all scenes to build except SimpleAR
  5. At Build Settings - Run in Xcode: Debug and ticket Development Build
  6. Project Settings-Player: Set a Company Name and Product name to build. In Other Settings: Rendering: Linear; Color Gamut add DisplayP3 to sRGB; Tick Metal API Validation, static batching, compute skinning; Set Api compatibility level to 4X; fill microphone disclaimer; Tick Mute other audio sources; untick allow http download; target device iPhone+iPad; Target SDK: Device SDK; Target min version iOS 13.0; Tick requires ARKit support, automatically add capabilities, hide home button, render extra frame on pause; Active input handling both
  7. Install latest URP package
  8. Create folder Rendergin and include URP forward pipeline and renderer. Add pipeline to Graphics scriptable render pipeline settings
  9. Install latest post processing from package. Should auto add to URP renderer.
  10. Delete ARKitBlendShapeVisualizer.cs in project
  11. File-Build settings - Run in Xcode as Debug, Run in Xcode Latest version, Build as Development build. Build
  12. Open resulting Unity-iPhone.xcodeproj
  13. In Xcode - UnityFramework Add AuthenticationServices.framework . In Build Phases - Build Binary with libraries set status to optional
  14. Unity iPhone add dev provisioning profile. In UnityFramework untick Automatically manage signing, set the team with signing cert.
  15. Build and deploy to iOS mobile device
    12 Launch app

Expected behavior Xcode does not show errors when the app launches

Actual behavior At launch error shows: [Subsystems] Loading plugin UnityARKit for subsystem ARKit-Input... [Subsystems] UnityARKit successfully registered Provider for ARKit-Input [Subsystems] Loading plugin UnityARKit for subsystem ARKit-Meshing... [Subsystems] Failed to initialize subsystem ARKit-Meshing [error: 1] New input system (experimental) initialized 2021-05-07 17:43:45.670357+0100[12896:1339705] fopen failed for data file: errno = 2 (No such file or directory) 2021-05-07 17:43:45.670467+0100 [12896:1339705] Errors found! Invalidating cache... 2021-05-07 17:43:46.099092+0100 [12896:1339705] fopen failed for data file: errno = 2 (No such file or directory) 2021-05-07 17:43:46.099196+0100[12896:1339705] Errors found! Invalidating cache... 2021-05-07 17:43:46.497900+0100[12896:1339705] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x115e5a1f0>.

Smartphone (please complete the following information):

tdmowrer commented 3 years ago

The message

Failed to initialize subsystem ARKit-Meshing [error: 1]

Is just telling you that meshing isn't supported (iPhone 6s doesn't support this). It is okay to ignore this. Besides the Xcode log, is anything not working as expected?

sergiosolorzano commented 3 years ago

That's very helpful @tdmowrer , great it's harmless, thank you so much for clarifying !

Is the fopen error also harmless in ARFoundation? I have not submitted the build to Apple and I'm a bit concerned as to whether the error may invalidate the build from being published in the store:

fopen failed for data file: errno = 2 (No such file or directory) Errors found! Invalidating cache...

I googled the error but could only find a reference to Metal being the culprit.

The dev build works fine when deployed from xcode to mobile.

tdmowrer commented 3 years ago

The fopen error does not come from AR Foundation, and I believe it is harmless.

sergiosolorzano commented 3 years ago

Thanks a bunch @tdmowrer !! I'll update this thread when I hear back from the team on fopen , if you prefer i can close this then

sergiosolorzano commented 3 years ago

Confirmed :)

this (fopen error) is not a bug and the error is correct. If it still occurs for you with LiDAR devices (shouldn't be the case), feel free to reply to this email and we will reopen the case.