juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.15k stars 524 forks source link

AR project, Universal Render Pipeline renders blackscreen #386

Closed danbruttyo2 closed 3 years ago

danbruttyo2 commented 3 years ago

I use AR Foundation and the Universal Render Pipeline package in Unity, and it works fine when building straight from Unity, but after exporting with the flutter plugin, it displays a blackscreen. The strange thing is that planes are still detected and displayed (so AR Foundation gets the camera information), but the camera's image is not rendered.

I suspect that the Universal RP package doesn't get exported with the other packages.

Has anybody faced this problem before?

timbotimbo commented 3 years ago

Did you follow these instructions to add an ARBackgroundRendererFeature? And if you already did, maybe try moving these files into a Resources folder instead of Rendering, to maybe force them to be included.

Haven't tested this yet, but I did run ARfoundation in URP before in flutter. I switched back because URP messed up on iOS, and don't remember what I did to set it all up.

I do remember having to add the following to proguard-user.txt in unity to deal with some camera permission issues. Not sure it is related, but it can't hurt to try.

-keep class com.unity3d.plugin.UnityAndroidPermissions** { *; }
-ignorewarnings