googlecodelabs / play-billing-codelab

Codelab to demonstrate new way of integration with Google Play billing
https://developer.android.com/google/play/billing/billing_library.html
Apache License 2.0
21 stars 16 forks source link

Can't destroy GamePlayActivity from emulator #3

Open dmmearns opened 7 years ago

dmmearns commented 7 years ago

I ran the app on an emulator (Nexus 5x API 25). On-screen rotation, I got the attached error. I'm guessing emulators can't connect to billing services? I got an error code 3 from onBillingSetupFinished(). Not a problem on my physical device.

log.txt

dmmearns commented 7 years ago

@gorgon

dmmearns commented 7 years ago

Changing destroy() in BillingManager form: public void destroy() { mBillingClient.endConnection(); }

to: public void destroy() { if (mBillingClient.isReady()) { mBillingClient.endConnection(); } } seems to have fixed this.

maxim-yudin commented 7 years ago

I have the same problem. Some information from Firebase attach.

2017-10-06 7 47 46

gorgon commented 7 years ago

Codelab is implemented to be as short as possible, so it doesn't handle the rotation properly. Please see TrivialDrive_v2 implementation for proper implementation. However, I agree, probably we need to add the same check inside the codelab for its next release.