# URP build always crash when 'Use SPR Batcher' is ON by default

**URL:** <https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809>\
**Category:** Bug Reports\
**Created:** [August 29, 2023, 3:07pm UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809 "2023-08-29T15:07:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Roh](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Jeremy\_Roh](https://community.nianticspatial.com/u/Jeremy_Roh)\
**Post date:** [August 29, 2023, 3:07pm UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/1 "2023-08-29T15:07:04Z")

</div>

_Include the following details while filing a bug report (edit as applicable):_

- **Issue category** : ARMeshManager/Mesh Generator
- **Device type & OS version** : Android
- **Host machine & OS version** : Mac
- **Issue Environment** : On Device
- **Xcode version** :
- **ARDK version** : 2.5.2
- **Unity version** : **Unity 2021.3.29f1**

> I hope it helps who are using URP and struggling with a crash on device when generating meshes.  
> A simple workaround to resolve the crash is to turn off ‘Use SRP Batcher’ option in ArdkUrpAsset.  
> The option is usually ON by default.

Bug reproduction steps:

With URP,

1. Use a material with the following custom shader created by shadergraph for AR Mesh  
[GeneratedFromGraph-ShadowReceiverMod.shader](https://community.nianticspatial.com/uploads/short-url/aaU3hbEEX47uojinas8Iv9vkXbp.shader) (64.7 KB)

2. Select ArdkUrpAsset

3. Switch Inspector mode to Debug

4. Search ‘Use SRP Batcher’, by default it is usually ON.

 ![Screenshot 2023-08-29 at 10.49.21 PM](https://us1.discourse-cdn.com/niantic/original/2X/2/2ec7c2545aa1bc29b776eb545b96fb9393e6964f.png)

1. If the option is ON, app crashes 100% while generating mesh via ARMeshManager.
2. Stacktrace shows it happens at **GfxDeviceGLES::DrawBuffersBatchMode**
3. I tested ‘Dyanmic Batching’ option and a relevant Tag - ‘Disable batching’ in some shader, it doesn’t matter. It is nothing to do with Dynamic batching, but it’s turned out to be SRP Batcher.

Crash log is as follows.

```auto
******  ******  ******  ******  ******  ******  ******  ******
Build fingerprint: 'google/bluejay/bluejay:13/TQ3A.230805.001/10316531:user/release-keys'
Revision: 'MP1.0'
ABI: 'arm64'
Timestamp: 2023-08-29 14:50:18.669731330+0800
Process uptime: 72s
Cmdline: { ***bundle_identifier*** }
pid: 29110, tid: 29296, name: Thread-8 >>> { ***bundle_identifier*** } <<<
uid: 10380
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x0000007170400000
    x0 0000005efe084840 x1 00000071703fffe0 x2 00000000000000e0 x3 0000005efe084980
    x4 0000007170400110 x5 0000005efe084af0 x6 0000000000000000 x7 0000000000000000
    x8 0000000000000000 x9 0000000000000000 x10 0000000000000000 x11 0000000000000000
    x12 0000000000000000 x13 0000000000000000 x14 00000071801877f0 x15 0000000000000023
    x16 00000072adc7acf0 x17 00000075d6bc2f20 x18 00000071abd18000 x19 0000000000000010
    x20 0000007246dd52c0 x21 0000000000000022 x22 00000071703ffe60 x23 0000005efe084840
    x24 00000000000002b0 x25 b40000741a52cc50 x26 00000000000002b0 x27 00000071d0457670
    x28 00000071ac848950 x29 00000000000000a0
    lr 00000072ad146c0c sp 00000071ac848690 pc 00000075d6bc2ecc pst 0000000020001000
backtrace:
      #00 pc 000000000004eecc /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+284) (BuildId: dc4001c2ef2dfc23467040797a96840c)
      #01 pc 000000000193cc08 /data/app/~~tj3lv7b-WWtkzM1sYJ1rVw==/{ ***bundle_identifier*** }-EdsH-Q3L1jgEYnGIt8Obpw==/lib/arm64/libunity.so ( **GfxDeviceGLES::DrawBuffersBatchMode** (GfxBatchHeader const&)+184) (BuildId: 8ceca445f342b58f)
      #02 pc 0000000001b42070 /data/app/~~tj3lv7b-WWtkzM1sYJ1rVw==/{ ***bundle_identifier*** }-EdsH-Q3L1jgEYnGIt8Obpw==/lib/arm64/libunity.so (GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)+29236) (BuildId: 8ceca445f342b58f)
      #03 pc 0000000001b3add8 /data/app/~~tj3lv7b-WWtkzM1sYJ1rVw==/{ ***bundle_identifier*** }-EdsH-Q3L1jgEYnGIt8Obpw==/lib/arm64/libunity.so (GfxDeviceWorker::RunExt(ThreadedStreamBuffer&)+84) (BuildId: 8ceca445f342b58f)
      #04 pc 0000000001b3ad78 /data/app/~~tj3lv7b-WWtkzM1sYJ1rVw==/{ ***bundle_identifier*** }-EdsH-Q3L1jgEYnGIt8Obpw==/lib/arm64/libunity.so (GfxDeviceWorker::Run()+140) (BuildId: 8ceca445f342b58f)
      #05 pc 0000000001b3aafc /data/app/~~tj3lv7b-WWtkzM1sYJ1rVw==/{ ***bundle_identifier*** }-EdsH-Q3L1jgEYnGIt8Obpw==/lib/arm64/libunity.so (GfxDeviceWorker::RunGfxDeviceWorker(void*)+4) (BuildId: 8ceca445f342b58f)
      #06 pc 0000000001069f64 /data/app/~~tj3lv7b-WWtkzM1sYJ1rVw==/{ ***bundle_identifier*** }-EdsH-Q3L1jgEYnGIt8Obpw==/lib/arm64/libunity.so (Thread::RunThreadWrapper(void*)+1048) (BuildId: 8ceca445f342b58f)
      #07 pc 00000000000c226c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: dc4001c2ef2dfc23467040797a96840c)
      #08 pc 0000000000054a30 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dc4001c2ef2dfc23467040797a96840c)

```

---

<div class="post-metadata">

**Author:** ![Dylan\_Smit](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/dylan_smit/32/562_2.png) [@Dylan\_Smit](https://community.nianticspatial.com/u/Dylan_Smit)\
**Post date:** [August 30, 2023, 6:51am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/2 "2023-08-30T06:51:55Z")

</div>

ARDK 2.X is not supported in Unity 2022.  
You should be able to ise the 3.0 beta without issue

---

<div class="post-metadata">

**Author:** ![Jeremy\_Roh](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Jeremy\_Roh](https://community.nianticspatial.com/u/Jeremy_Roh)\
**Post date:** [August 30, 2023, 6:56am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/3 "2023-08-30T06:56:03Z")

</div>

Hi Dylan Smit,

- As mentioned in the report, I’ve already tested Unity2021.3 which is the official support version. The issue doesn’t matter with the Unity version.
- It is confirmed that Unity2021.3 has the issue.
- In order to avoid any configuration just in case, I’ve removed the version info of Unity2022 which was my own test for experiment.

---

<div class="post-metadata">

**Author:** ![Dylan\_Smit](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/dylan_smit/32/562_2.png) [@Dylan\_Smit](https://community.nianticspatial.com/u/Dylan_Smit)\
**Post date:** [August 30, 2023, 7:07am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/4 "2023-08-30T07:07:30Z")

</div>

Oh interesting. I’ve never had issues with it.  
Could you share the urp asset and urp renderer settings?  
And maybe player settings are helpful.

Otherwise 3.0 beta should still work if the project is planned to release on a later date

---

<div class="post-metadata">

**Author:** ![Jeremy\_Roh](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Jeremy\_Roh](https://community.nianticspatial.com/u/Jeremy_Roh)\
**Post date:** [August 30, 2023, 7:34am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/5 "2023-08-30T07:34:04Z")

</div>

As for those ArdkUrpAsset and PlayerSettings, there’s nothing special. They keep almost default settings.

Instead, I should’ve pointed out that it could depend on some correlation between a certain shader and SRP batcher.

I’m trying to use [ShadowReceiver shader](https://github.com/Cyanilux/URP_ShaderGraphCustomLighting/blob/main/Examples/ShadowReceiver.shadergraph) to render AR Meshes. Probably the crash is linked up with correlation between the shader and SRP Batcher.

The following is the generated shader code from the shadergraph for reference.  
The subshader Tag “DisableBatching” does not have any effect as mentioned above.

The attachment is a generated shader script from the shadergraph for reference.  
[GeneratedFromGraph-ShadowReceiverMod.shader](https://community.nianticspatial.com/uploads/short-url/aaU3hbEEX47uojinas8Iv9vkXbp.shader) (64.7 KB)

**I’ve updated the original post too**

---

<div class="post-metadata">

**Author:** ![Dylan\_Smit](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/dylan_smit/32/562_2.png) [@Dylan\_Smit](https://community.nianticspatial.com/u/Dylan_Smit)\
**Post date:** [August 30, 2023, 7:47am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/6 "2023-08-30T07:47:55Z")

</div>

So it does work without the shader?

If so, maybe try one of my shaders

> **[Shadow Receiver URP (Directional & Additional Light Shadows) | VFX Shaders...](https://assetstore.unity.com/packages/vfx/shaders/shadow-receiver-urp-directional-additional-light-shadows-228069)**
>
> Add depth to your next project with Shadow Receiver URP (Directional & Additional Light Shadows) from Dev Dunk Studio. Find this & more VFX Shaders on the Unity Asset Store.

> **[Shadow Receiver URP (FREE) | VFX Shaders | Unity Asset Store](https://assetstore.unity.com/packages/vfx/shaders/shadow-receiver-urp-free-228074)**
>
> Add depth to your next project with Shadow Receiver URP (FREE) from Dev Dunk Studio. Find this & more VFX Shaders on the Unity Asset Store.

---

<div class="post-metadata">

**Author:** ![Jeremy\_Roh](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Jeremy\_Roh](https://community.nianticspatial.com/u/Jeremy_Roh)\
**Post date:** [August 30, 2023, 8:02am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/7 "2023-08-30T08:02:49Z")

</div>

Thanks for the suggestion. By the way, without SRP batcher option, all is okay now. It doesn’t seem to affect any other features so far. That’s probably because my app is still very beginning that many further features have yet to be implemented.

There would be some workarounds to avoid the issue like using your shader.

I’ve reported it because I’d like to see if it’s a ARDK bug or Unity Bug, or if some particular shader function is just incompatible with ARDK. I haven’t digged deeper in that shader though to see even if it’s a shader bug.

---

<div class="post-metadata">

**Author:** ![Dylan\_Smit](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/dylan_smit/32/562_2.png) [@Dylan\_Smit](https://community.nianticspatial.com/u/Dylan_Smit)\
**Post date:** [August 30, 2023, 8:21am UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/8 "2023-08-30T08:21:34Z")

</div>

Srp batcher can greatly improve performance, especially on mobile, so it would be great to get it working of the project will grow

---

<div class="post-metadata">

**Author:** ![Jeremy\_Roh](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Jeremy\_Roh](https://community.nianticspatial.com/u/Jeremy_Roh)\
**Post date:** [August 30, 2023, 1:09pm UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/9 "2023-08-30T13:09:14Z")

</div>

I found my build pipeline was messed up, and it referred to different version of Unity instead of 2021 for the previous build process. I have fixed it and trying to rebuild it properly. And then I will test this issue for Unity2021 and update the post again.

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [August 30, 2023, 2:04pm UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/10 "2023-08-30T14:04:03Z")

</div>

Hi Jeremy,

I followed the steps you provided on a fresh project and didn’t encounter any issues with an iPhone 13 Pro running iOS 16.1.2. I will get some telemetry on an Android device later today and will get back to you; however, as you mentioned, it sounds like something isn’t quite right with your specific render pipeline settings.

Kind Regards,  
Maverick L.

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [March 5, 2026, 11:46pm UTC](https://community.nianticspatial.com/t/urp-build-always-crash-when-use-spr-batcher-is-on-by-default/3809/11 "2026-03-05T23:46:53Z")

</div>

Age
