yasirkula / UnityAndroidRuntimePermissions

A native Unity plugin to handle runtime permissions on Android M+
MIT License
196 stars 29 forks source link

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

Open smuttleralph opened 5 years ago

smuttleralph commented 5 years ago

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/

yasirkula commented 5 years ago

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

smuttleralph commented 5 years ago

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 notifications@github.com: 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].

yasirkula commented 5 years ago

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

smuttleralph commented 5 years ago

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

Am 31.10.2019 18:12:13 schrieb Süleyman Yasir KULA notifications@github.com: 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].

BenF-GD commented 2 years ago

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.

yasirkula commented 2 years ago

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

yasirkula commented 2 years ago

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

BenF-GD commented 2 years ago

@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!