Unity-Technologies / arfoundation-samples

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

[Bug] [IN-47249] No XR platforms included in ubuntu command line build #1090

Closed camnewnham closed 3 weeks ago

camnewnham commented 11 months ago

Unity bug report case number IN-47249

Describe the bug Building on unbutu CI results in ARCore not being loaded, no permissions requested, and a black screen. There is no mention of ARPresto in the android logs, and no ARSession is loaded.

To Reproduce Run an ubuntu build on github actions for the attached basic project, or alternatively I have these publicly available here. Sideload the APK artifact.

Expected behavior Back camera feed is displayed, XRSession is normally initialized

Actual behavior Black screen, no reference of arPresto in the logs. Build is ~15mb smaller than a normal build.

Smartphone

Other Notes Manually including the XR related preloaded assets (shaders, XRGeneralSettings, etc.) in source control (ProjectSettings) resolves the issue (but then building for iOS doesn't work, or visa versa with iOS preloaded assets)

Context: https://forum.unity.com/threads/issue-with-android-skipped-rendering-frame-because-gfxdevice-is-in-invalid-state-device-lost.1449145/#post-9136096

camnewnham commented 11 months ago

Temporary workarounds for anyone coming across this issue: Create a separate branch for iOS and Android, containing the platform-specific preloaded assets in ProjectSettings. Use these branches in your ubuntu-based CI.

Creating a script to assign the preloaded assets manually (IPreprocessBuildWithReport) did not resolve the issue - I suspect they are being overwritten somewhere by the XR plugin.

cjwills commented 3 weeks ago

I looked at the example project and the issue was that ARCore was not enabled in XR Plug-in Management. After enabling it I got a working apk from the github action CI.

Please let us know if this is still an issue for you.