Custom render feature does not work in Android build.

Hi Unity Community,

I’ve encountered a peculiar issue while working on a Sobel outline based on the render feature. The outline pass works well in the Editor, but it fails in the build. Upon investigating with ADB framedebugger, I noticed that the draw call disappeared. I attempted using another material, but it had no effect, leading me to believe it’s not related to shader issues.

I’ve ensured that the depth and opaque texture are enabled. ADB framedebugger indicates that the correct pipeline asset renderer is in use. I even tried adding log statements inside the render feature, but no logs were generated. Interestingly, when I added built-in SSAO, it worked as expected.

Android Studio reports the following error: “Unity: A scripted object (probably BlitMaterialFeature?) has a different serialization layout when loading. (Read 44 bytes but expected 72 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?” However, I did not use any #ifdef UNITY_EDITOR, and the script is not inside an Editor folder. I suspect it might be related to the bundle configuration, as the project is using asset addressable.

The Unity version is 2021.3.29f1, and the URP version is 12.1.12. I’ve attached my render feature code below. Any hints or suggestions would be greatly appreciated!

9559423–1351579–BlitMaterialFeature.cs (3.55 KB)

The issue has been resolved. Our project employs HybridCLR. Render features should be placed in a distinct assembly, separate from the hot-fix assembly.