UnityAndroidRuntimePermissions icon indicating copy to clipboard operation
UnityAndroidRuntimePermissions copied to clipboard

Android 6.0 Unity : Timeout while trying to pause the Unity Engine.

Open smuttleralph opened this issue 5 years ago • 8 comments

On android 6.0 our game freezes when we request the runtime permissions for fine and course location. Could this be the reason?: https://forum.unity.com/threads/crash-on-immediate-restart-timeout-while-trying-to-pause-the-unity-engine-before-win-death.313408/

smuttleralph avatar Oct 31 '19 16:10 smuttleralph

This log message appears in normal circumstances, as well. Does the app freeze indefinitely? Are you using the latest version of the plugin?

yasirkula avatar Oct 31 '19 17:10 yasirkula

Does the app freeze indefinitely?  yes, until i get an ANR. higher api versions than Android 6 work fine, btw.

Are you using the latest version of the plugin? Ralph Kunz: yes 1.1

Am 31.10.2019 18:01:32 schrieb Süleyman Yasir KULA [email protected]: This log message appears in normal circumstances, as well. Does the app freeze indefinitely? Are you using the latest version of the plugin? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/yasirkula/UnityAndroidRuntimePermissions/issues/3?email_source=notifications&email_token=ADRB4K3UQY27VLBOWVDXHATQRMFOXA5CNFSM4JHNSRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECYQOFA#issuecomment-548472596], or unsubscribe [https://github.com/notifications/unsubscribe-auth/ADRB4K42XDOGQJZV4MSVY4LQRMFOXANCNFSM4JHNSRJA].

smuttleralph avatar Oct 31 '19 17:10 smuttleralph

To be honest, I don't even know where to look. Are there any other error messages? In the worst case, you can make the asynchronous permission functions public and try using them: https://github.com/yasirkula/UnityAndroidRuntimePermissions/blob/4719de5ebb576d03719e194657c1f4590bf6b5ed/Plugins/AndroidRuntimePermissions/AndroidRuntimePermissions.cs#L130-L155

yasirkula avatar Oct 31 '19 17:10 yasirkula

Thanks a lot. I'll give the asynchronous functions a try! 

Am 31.10.2019 18:12:13 schrieb Süleyman Yasir KULA [email protected]: To be honest, I don't even know where to look. Are there any other error messages? In the worst case, you can uncomment the asynchronous permission functions and try using them: https://github.com/yasirkula/UnityAndroidRuntimePermissions/blob/4719de5ebb576d03719e194657c1f4590bf6b5ed/Plugins/AndroidRuntimePermissions/AndroidRuntimePermissions.cs#L130-L155 [https://github.com/yasirkula/UnityAndroidRuntimePermissions/blob/4719de5ebb576d03719e194657c1f4590bf6b5ed/Plugins/AndroidRuntimePermissions/AndroidRuntimePermissions.cs#L130-L155] — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/yasirkula/UnityAndroidRuntimePermissions/issues/3?email_source=notifications&email_token=ADRB4K2RBQS6UGFQI3VCBN3QRMGWVA5CNFSM4JHNSRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECYRTLA#issuecomment-548477356], or unsubscribe [https://github.com/notifications/unsubscribe-auth/ADRB4K7XN2GXB3IW227Q7ADQRMGWVANCNFSM4JHNSRJA].

smuttleralph avatar Nov 04 '19 08:11 smuttleralph

I had the same issue when attempting to get permissions on Android 12 (using Unity 2020.3.26). Using the Async method fixed the issue for me.

BenF-GD avatar Feb 04 '22 08:02 BenF-GD

That's worrying. Thanks for sharing your findings and the details.

yasirkula avatar Feb 04 '22 09:02 yasirkula

@BenF-GD Does the permission popup show up at all or does it freeze without presenting the popup?

yasirkula avatar Feb 05 '22 16:02 yasirkula

@yasirkula No permission popup was shown! Not that it should make any difference at all, but for completeness, I am requesting android.permission.BLUETOOTH_CONNECT. My unity app targets SDK 31, with a min SDK of 26.

As I say, making the equivalent async method public (and then calling that) works well. Have tested that across multiple devices, running android 10-12 (though its only devices running 12 that actually needs this particular permission).

I should also thank you! The built-in Unity process didn't work at all for this permission and your little plugin saved me a day or so, and as its free, I appreciate your work - cheers!

BenF-GD avatar Feb 05 '22 16:02 BenF-GD