[Crash] Unity with GearVR can crash after allowing permissions after first installation

Hi,

I’ve got a crash on my game after allowing permissions after the first installation.
I have no idea how I can avoid this.

Logs (end) : 08-31 09:57:54.291: V/VRSystem(29224): at (VrViewActivity.java:89) onPause() [on - Pastebin.com

android.view.WindowLeaked: Activity com.samsung.android.hmt.vrsystem.permission.PermissionActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{e3461c3 V.E...... R.....ID 0,0-1280,960} that was originally added here

Had anyone got this problem before?
(I understand the actual issue, but since it’s Unity’ side… android - Activity has leaked window that was originally added - Stack Overflow)

When I build only one scene (on 3), it works just fine… but that’s not a solution.

Thanks in advance,
Sylafrs

Edit: Strange, it happens on my samsung s6 but not on the s6 of my friend. I guess my phone has an issue…

Okay, my solution was to set the targetSdkVersion below 23. (so between 19 and 22 included).
I set it to 19.

With this target, the permissions aren’t asked at runtime but it’s asked during setup, so the permission activity doesn’t start and can’t crash.