Open sayiliromer opened 5 years ago
Do you have proguard enabled?
It is disabled in the player settings. But i am not sure if something is overriding it in some place. Is there any way that i can be sure ?
We are using custom gradle template, here it is mainTemplate.txt
Can you try to create a new project and use it with Minimal sample from https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/samples folder, please? You can use the Play Games setup from your project - just copy 'Window->Google Play Games->Setup->Android Setup' window content.
Can you try to create a new project and use it with Minimal sample from https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/samples folder, please? You can use the Play Games setup from your project - just copy 'Window->Google Play Games->Setup->Android Setup' window content.
I am gonna try it, but it is hard to reproduce. I experienced it only once
@olehkuznetsov All right. I have an update for this issue. It is most probably a unity bug. Finally i am able to reproduce it. If you quit app with Application.Quit() (Which is most probably with back button) application throws some exceptions
android.app.IntentReceiverLeaked: Activity com.unity3d.player.UnityPlayerActivity has leaked IntentReceiver com.unity.purchasing.googleplay.GooglePlayPurchasing$4@56ef208 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.ServiceConnectionLeaked: Activity com.unity3d.player.UnityPlayerActivity has leaked ServiceConnection null that was originally bound here
etc.
And after that. If you relaunch app again. It fails to initialize gpg plugin with that exception
InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK
But if you kill app from Overview screen or application manager. Everything works fine. My workaround for the issue is when you press back button, Instead of killing app, now i am dropping into background.
Here some reports about the bug https://issuetracker.unity3d.com/issues/activity-has-leaked-serviceconnection-errors-when-calling-application-dot-unload
https://forum.unity.com/threads/crash-with-back-button.605983/
@sayiliromer I can consistently reproduce this on a Samsung S III running Android 4.4.4, and I tried with Unity 2019.1.3f1, which has the fix to issue 1091255, but the InvalidOperationException on the GamesService object still occurs.
I also noted that after waiting overnight, a second authentication attempt worked without the error, so there's apparently some time-out at some point. This might explain why the problem is intermittent.
More info on my case: When connected to logcat, I also see this error: E/GamesNativeSDK: Can only create one instance of GameServices at a time.
i had same case with unity 2018.4.2f and 0.9.64
I have same error , did anyone can fix this ?
Same here with Unity 2019.1.6f1.. Unity already announced to fix this but they don't commit to a version or date :-/
Same here with Unity 2019.1.6f1.. Unity already announced to fix this but they don't commit to a version or date :-/
@rubenaster What fix did Unity announce for this? Link?
@cmeil They are currently fixing the leakage of Activities: https://forum.unity.com/threads/android-2018-3-13-unitypurchasing-dont-initialize-after-application-quit.665497/#post-4646566
I fixed this Unity issue with this workaround: https://forum.unity.com/threads/android-2018-3-13-unitypurchasing-dont-initialize-after-application-quit.665497/#post-4595101 Our internal tests are positive, we are going to release this in Beta soon to see if there is any issue with any specific device.
Please be advised that https://issuetracker.unity3d.com/issues/activity-has-leaked-serviceconnection-errors-when-calling-application-dot-unload is not related to this issue and/or it is not really fixed in 2019.1: we were "fooled" by that "fixed in 2019.1" tag and we updated Unity from 2018.4 to 2019.1 in order to fix this issue which instead still persisted. I am evaluating if we should revert to 2018.4 or keep going with 2019.1.
This solution looks good
new AndroidJavaClass("java.lang.System").CallStatic("exit", 0);
Application.Quit();
Unity has fixed this now (https://forum.unity.com/threads/solved-android-2018-3-13-unitypurchasing-dont-initialize-after-application-quit.665497/page-2)
I have same problem in 2018.3.14. It is resolved in 2019.3.
We are having this issue since we updated gpg plugin version to 0.9.62 and switched scripting backend to il2cpp. currently we are using 0.9.63. and still having same issue. Unity diagnostics dashboard is full of that exception.
It is not always happening. Sometimes it is working without issue