mvysny / aedict

Original Aedict 2 source codes
http://www.aedict.eu
GNU General Public License v3.0
40 stars 7 forks source link

Billing Error #973

Open flobauke opened 1 year ago

flobauke commented 1 year ago

Thank you for making the time to report a bug and make Aedict better!

Thank you for your interest in Aedict. Prior submitting bugs, please make sure that you have newest Aedict from Google Play.

A screenshot is often worth a thousand words, so please make sure to include one ;)

Please provide:

  1. Your phone brand and maker
  2. The exact Android version.
  3. A screenshot if possible; even better, a youtube video demonstrating the issue.
  4. A full description of the issue you're experiencing. For example: I used to read manga with the MangaReader Android app, while having the Aedict Reader popup floating. I could click the Reader window, select word search and type in the word to look up. Now the virtual keyboard doesn't pop up. You suck :-D
flobauke commented 1 year ago

For about 2 weeks I constantly get the penetrant error message "Biling Error #5"

"Billing Error #5 Developer Error: Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest: java.lang.Throwable: Client is already in the process of contacting to billing service."

This message disappeared completely after I deinstalled Aedict3 but came back in an instant after installing Aedict3 again.

Devices: Readmi Note 7 and GalaxyTab A8

It's probably related to issue #970

mvysny commented 1 year ago

Thank you for letting me know. The issue was caused by a misconfiguration on Google's side, but now everything should be resolved. I just checked and payments from other users are coming through, so everything seems to be working properly.

Let me check where the message could come from. However, it sounds like a communication is being established to Google Play, and the issue could be only temporary. Could you please try to reboot your phone and try again?

mvysny commented 1 year ago

If the issue would persist, I'll need a stacktrace of the exception from your phone. Would you be interested in doing so and posting it here? Please try to follow http://www.aedict.eu/faq.html section "Aedict 3 log"

topherbuckley commented 1 year ago

Just chiming in to say that I was having the same issue and wasn't near a computer so didn't realize it was Aedict (or related Google Play API) causing the issue. I'm happy to generate a stack trace, but I'm not sure how to forcefully recreate the toast billing error message. It came at seemingly random times. @mvysny any good ideas for recreating the error?

Also I noticed the FAQ references the deprecated Android Device Monitor so you may want to update the FAQ to either use systrace, Android Studio's built-in logcat, or the adb logcat.

topherbuckley commented 1 year ago

I made a screenshot of the toast message a few days ago if it is of any use:

Screenshot_20220920-182200

mvysny commented 1 year ago

@topherbuckley Unfortunately I have no idea how to reproduce this issue. I'm even at loss as to the cause of this ticket. The Aedict purchasing configuration in Google Play however was broken a month ago, that is correct. Could it be that Google Play on your device somehow cached this "broken result"? No idea unfortunately. It works for me and for other users as well. Could you try rebooting your phone, to see whether that would help?

Also I noticed the FAQ references the deprecated Android Device Monitor so you may want to update the FAQ to either use systrace, Android Studio's built-in logcat, or the adb logcat.

Excellent catch, I'll update the documentation.

flobauke commented 1 year ago

I looks like wiping all Play Store data and rebooting my phone resolved the issue for me. I used Aedict very intensively today but did not get the error message once. Maybe this works for topherbuckley too?

mvysny commented 1 year ago

Excellent fix @flobauke thank you so much for sharing.

topherbuckley commented 1 year ago

I haven't seen the toast message recently, but if I see it again I will try clearing the play store cache and/or data as mentioned. Will follow up if I see it. Otherwise maybe this can be closed until it reappears?

mvysny commented 1 year ago

Sounds good to me. I'll close the ticket but please feel free to reopen if the issue reappears.

Closing as duplicate of #970

mikemorr commented 1 year ago

Hi Martin, I deleted Play Store data and rebooted, but I'm getting these toasts as well. The ones I've seen say:

Billing error #3 Billing Unavailable: Billing API version is not supported for the type requested: java.lang.Throwable: Google Play In-app Billing API version is less than 3

and:

Billing error #5 Developer Error: Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest: java.lang.Throwable: Client is already in the process of connecting to billing service.

I captured some logcat that may be of use, which I will email to you.

greggilbert commented 1 year ago

@mvysny I'm getting the same errors mentioned here.

Billing error #5 Developer Error: invalid arguments provided...

It's similar to the previous ticket, but a different error code. This is v3.50.25 of the app.

topherbuckley commented 1 year ago

I can also confirm that these are still occurring for me. I'll try to grab a logcat if I'm near a PC when they happen next time.

mvysny commented 1 year ago

Thank you. @mikemorr I've received the log from your phone, the relevant part of the log is attached here:

10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases: onBillingError #3 Billing Unavailable: Billing API version is not supported for the type requested
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases: java.lang.Throwable: Google Play In-app Billing API version is less than 3
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at com.anjlab.android.iab.v3.BillingProcessor$2.onBillingSetupFinished(BillingProcessor.java:303)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzaf.zzd(com.android.billingclient:billing@@4.0.0:1)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzaf.zza(com.android.billingclient:billing@@4.0.0:26)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzae.call(Unknown Source:2)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-08 15:23:22.695 31079 31079 E Aedict:InAppPurchases:  at java.lang.Thread.run(Thread.java:923)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases: Billing error #3 Billing Unavailable: Billing API version is not supported for the type requested: java.lang.Throwable: Google Play In-app Billing API version is less than 3
10-08 15:23:22.696 31079 31792 W BillingClient: Exception while checking if billing is supported; try to reconnect
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases: onBillingError #3 Billing Unavailable: Billing API version is not supported for the type requested
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases: java.lang.Throwable: Google Play In-app Billing API version is less than 3
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at com.anjlab.android.iab.v3.BillingProcessor$2.onBillingSetupFinished(BillingProcessor.java:303)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzaf.zzd(com.android.billingclient:billing@@4.0.0:1)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzaf.zza(com.android.billingclient:billing@@4.0.0:26)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzae.call(Unknown Source:2)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases:  at java.lang.Thread.run(Thread.java:923)
10-08 15:23:22.696 31079 31079 E Aedict:InAppPurchases: Billing error #3 Billing Unavailable: Billing API version is not supported for the type requested: java.lang.Throwable: Google Play In-app Billing API version is less than 3
10-08 15:23:22.697  2983  2983 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2169 repeatCheckTimes = 0, unlocked = false
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases: onBillingError #3 Billing Unavailable: Billing API version is not supported for the type requested
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases: java.lang.Throwable: Google Play In-app Billing API version is less than 3
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at com.anjlab.android.iab.v3.BillingProcessor$2.onBillingSetupFinished(BillingProcessor.java:303)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzaf.zzd(com.android.billingclient:billing@@4.0.0:1)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzaf.zza(com.android.billingclient:billing@@4.0.0:26)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at com.android.billingclient.api.zzae.call(Unknown Source:2)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-08 15:23:22.697 31079 31079 E Aedict:InAppPurchases:  at java.lang.Thread.run(Thread.java:923)

The error is coming straight from Google Play as can be seen in the stack-trace. Unfortunately there's not much I can do about crappy Google code.

I've tried to google around and this came up: https://stackoverflow.com/questions/67738549/billingclient-in-app-billing-api-version-3-is-not-supported-on-this-device . It suggests that you need to add an account to Google Play, but that kind of bug refers to situation when the app is run in the Android Emulator. This ticket suggests the same too: https://github.com/RevenueCat/purchases-flutter/issues/92 . This ticket https://github.com/flutter/flutter/issues/64401 suggests that Google Play is having temporary issues.

I have just verified that payments from other users are coming through just fine. Have you tried to force-stop the Google Play app and clearing its cache, then rebooting the device please?

This https://community.revenuecat.com/third-party-integrations-53/google-play-in-app-billing-api-version-is-less-than-3-1323 suggests that Google Play is too old on your device.... Which sounds ridiculous.

All research points to a problem within the Google Play itself.

I honestly do not know how to proceed from here.

mikemorr commented 1 year ago

@mvysny I have just now force-stopped the Google Play Store app, cleared its cache, and rebooted the phone. If the toasts appear again, I'll let you know. But it does appear that my subscription payment went through correctly on Sunday October 9th, as normally scheduled.

mikemorr commented 1 year ago

It occurs to me that the toasts have been appearing on my new phone I just got, but my old phone (sitting in a drawer, but still powered on) still had Aedict installed too. I wonder if the problem was that both phones were trying to bill simultaneously?

mikemorr commented 1 year ago

For now, is there a way to block the toast messages?

mvysny commented 1 year ago

@mikemorr unfortunately not at the moment. But I agree that those can be quite annoying. I'll rework it and show those messages in the "About" screen instead.

topherbuckley commented 1 year ago

I'm not seeing similar API 3 errors in my logcat. Instead I'm seeing what doesn't even appear to be an "error" per se. I copied the logcat to my pc with adb logcat > logcat but it appears logcat produces a stream rather than a file, so I ctrl+c to truncate it. Then I grep it with grep -i "aedict" logcat. Lines around the time of the toast are as follows:

10-13 19:35:09.589  1463  5234 W NotificationService: Toast already killed. pkg=sk.baka.aedict3 token=android.os.BinderProxy@177113d
10-13 19:41:04.055 17949 17965 I Finsky  : [43570] gxr.a(14): sk.baka.aedict3: Account determined from installer data - [REDACTED]
10-13 19:41:04.074 17949 17965 I Finsky  : [43570] gxr.a(62): Billing preferred account via installer for sk.baka.aedict3: [REDACTED]
10-13 19:41:04.113 17949 17965 I Finsky  : [43570] gxr.a(14): sk.baka.aedict3: Account determined from installer data - [REDACTED]
10-13 19:41:04.115 17949 17965 I Finsky  : [43570] gxr.a(62): Billing preferred account via installer for sk.baka.aedict3: [REDACTED]
10-13 19:41:04.130 15280 15280 I Aedict:InAppPurchases: aedict.ultimate is now subscribed

There were a few minutes between seeing the toast and hooking up to the PC, but it looks like I have plenty of log messages from well before this, so I guess this includes everything. Is there any way of producing a more verbose log?

mvysny commented 1 year ago

According to https://developer.android.com/studio/command-line/logcat#filteringOutput , adb should print everything including debug messages. Aedict will not log debug messages in production though, so unfortunately that will not work.

However, this line is very interesting: Aedict:InAppPurchases: aedict.ultimate is now subscribed

That means that Aedict was in fact able to connect to Google Play, obtain the list of subscriptions and verify that the Aedict Ultimate is correctly purchased on your phone. Judging from that, you should not be getting any kind of error toasts.... If you are, then perhaps first couple of attempts to connect to Google Play failed, and finally one attempt went through correctly.

If that is true, there should be lots of exceptions from Aedict in the error log as shown in the comment https://github.com/mvysny/aedict/issues/973#issuecomment-1274965271 .

@topherbuckley can you please confirm that you're getting the toasts but you can not see any exceptions matching Aedict:InAppPurchases?

topherbuckley commented 1 year ago

@mvysny what do you recommend for getting the most verbose log using the production version if not the logcat output?

It hasn't happened recently so I've increased by log buffer from the default of 256k to 16M. Hopefully I'll catch it with this length of a log.

I'm using adb logcat -d -e "Aedict" to search for this btw. A bit faster than my grep approach before.

mikemorr commented 1 year ago

@topherbuckley I wonder whether the search is case-sensitive? Since some log lines have 'Aedict' and some have 'aedict' it might help to look for 'edict'.

mvysny commented 1 year ago

@topherbuckley to get most verbose log you would continue using adb logcat but you would need a debug build of Aedict. However, the InAppPurchases class only logs INFO, WARNING and ERROR (so no debug), so the debug build wouldn't help in this case.

mvysny commented 1 year ago

I just experienced the same issue: aedict started to complain about error no.5. Clearing Google Play data helped immediately. This is clearly Google play issue.

For further reference, I first killed all apps on my phone. Then I went to phone settings, then "apps", then "app management", searched for the "Google play store" app, then clicked "Force Stop". Then I went to "storage usage" and clicked "clear data" and "clear cache ".

Afterwards I launched Google play, then aedict, then verified that the Aedict Ultimate now works properly.

mikemorr commented 1 year ago

Clearing the Play data helps for a short while, but the toast messages come back for me within a few days.

mvysny commented 1 year ago

Thank you for letting me know. Unfortunately I suspected as much. Google put the payments on hold without any prior notice until I fill in some EU-related paperwork. I did that yesterday, and it will take a couple of business days to sort this out. Please let's wait until everything is sorted out.

mvysny commented 1 year ago

I have received an e-mail from Google that the payments should hopefully be sorted out again. Let's hope for the best :) Closing as fixed, please reopen if you start experiencing the issue again.

mikemorr commented 1 year ago

The messages are appearing again. I'm on Android 12 now.

mvysny commented 1 year ago

I'm sorry to hear that. Let me talk to Google.

mvysny commented 1 year ago

As a bare minimum, I'll convert the error messages from annoying Toasts to something else. Perhaps I'll make Aedict remember a short log and I can show it in the "About" screen, in the bottom-most "Advanced" section.

mvysny commented 1 year ago

@mikemorr toasts should now be gone; the log should be shown in the "About" activity now. Fixed in Aedict 3.50.26. I'll release a new version shortly.

istrasci commented 1 year ago

@mikemorr toasts should now be gone; the log should be shown in the "About" activity now. Fixed in Aedict 3.50.26. I'll release a new version shortly.

I am still getting these toasts in Aedict 3.50.26. And I don't even have a subscription to Ultimate.

mvysny commented 1 year ago

Thank you, should be fixed. Now the toast will only appear when the user is trying to purchase something; and should only appear once.

I'll create a new release soon. This bug should be fixed in Aedict 3.50.27

mikemorr commented 1 year ago

For me this issue is fixed since updating to 3.50.27. Thanks!