yasirkula / UnityNativeShare

A Unity plugin to natively share files (images, videos, documents, etc.) and/or plain text on Android & iOS
MIT License
891 stars 131 forks source link

Native share freezes on Android #74

Closed charleshan closed 3 years ago

charleshan commented 4 years ago

I already found the solution but I want to document my finding here. Unity was freezing on Android after successfully sharing.

05-03 17:01:12.637 21769 21769 W Unity   : Timeout while trying to pause the Unity Engine.
05-03 17:01:12.643 21769 21769 I Unity   : windowFocusChanged: false
05-03 17:01:24.398 21769 21769 W Unity   : Timeout while trying detaching primary window.
05-03 17:01:31.239 21769 21769 I Unity   : onResume
05-03 17:01:31.295 21769 21769 I Unity   : windowFocusChanged: true

The cause was the Minify settings found in Player settings > Player > Minify > Release. I had it on Gradle. I changed to Proguard and that fixed the issue.

Note: Another thread https://github.com/yasirkula/UnityNativeShare/issues/46#issuecomment-514664513 suggested to try None.