My app fails Play Store pre-launch tests

Is this only an issue when using companion ?
My app fails Play Store pre-launch tests with this error, never tried it with companion.

Exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get (ArrayList.java:437)
at com.jewel.googleplaybilling.repacked.hd.run (Unknown Source:11)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:201)
at android.os.Looper.loop (Looper.java:288)
at android.app.ActivityThread.main (ActivityThread.java:7839)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)

If i disable the extension in my app then it passes the tests no problem.

Ive had the extension in my app for over a year without any issues.

Your error indicates that you are trying to get an element from an empty list. Wherever you get an element from the list, add the condition "if it is not empty".

But I think it might be coming from google billing extension, or due to bad use of the extension.

Ok, runs fine on my phone but fails the google tests ... ill check it out

Your error message is slightly different... I now moved it into its own thread...

Taifun

I don't know exactly, but I think Google billing only works for apps installed from Google Play. So you can't test this extension in an app installed from an apk file, right?

Maybe @JEWEL can say more.

1 Like

Its the process used for testing the google pay system in apps.
I can install the apk, as im a registered tester it goes through the Google play purchase process, allowing me to use a "test" credit card for the purchase. witch all goes through payment process and allows the app to install and run.
I get a receipt from Google thanking me for the dummy subscription.

Everything works perfectly but it fails the pre launch tests.

Which extension are you using? Any link? Probably the author of the extension does have a suggestion?

Taifun

I have already contacted Jewel (yesterday) he is aware and i have sent him a link to this thread

The Google pay extension and the Google system process the purchase perfectly, the app installs and runs just as it should but the package fails Google pre-launch tests unless I disable the pay extension.

Since it has been working for a long time and recently you are getting an unexpected issue, I suggest you try with the latest v7.1.1. I think you are using v6.0.1.

Yes, I am using v6.0.1. but not aware of any reason that is an issue.

Google Play Billing Library version deprecation - Support timeline For different versions - 6 Last date version can be used to release new apps or updates to existing apps Aug-31-2025

6.0.1 ● Update Play Billing Library to be compatible with Android 14.

I understand you point but I so no reason that v6.0.1. shouldn't be ok, so there is something else at fault here.

If the extension author updated the extension, then they had a reason to do so and you should always use the latest version, at least if something doesn't work and you need to find out what. So first update the extension, then let us know if the error still occurs.

The extension author is just as confused as me and investigating.

The extension author suggested to try the latest version
What exactly prevents you from following that suggestion?

Taifun

You are incorrect, maybe best to stick to the facts.

???

So what happens , if you try the latest version?

Taifun

He just sent me 3 minutes ago via WhatsApp "You may try these extensions. They're all super stable, and a bunch of my clients still use them." V6.1.0

That message is here in this thread and visible for everyone here

If I were you, I would try the latest version
Taifun

His suggestion to me in personal conversation via what's app just 5 minutes ago is to try v6.1.0 so that's what I'll do

I tried v6.1.0 as suggested by Jewel didnt help, downloaded v7.1.1
I built the apk and installed it on a phone to test it works ok, recorded the screen of the tests (cant upload here as the file is too large, sent to Jewel via whatsapp) the video shows the app open the google pay dialogs allows me to try to subscribe with the declining test credit card, then to go on and subscribe with the approved paying test credit card successfully. Everything works perfectly communication and payments made to the google system are all ok.
Then built the abb file to upload to play console... uploaded the app for internal testing ... it fails the pre-launch tests with the error below.
Exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get (ArrayList.java:437)
at com.jewel.googleplaybilling.repacked.nk.run (Unknown Source:11)
at android.os.Handler.handleCallback (Handler.java:942)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:201)
at android.os.Looper.loop (Looper.java:288)
at android.app.ActivityThread.main (ActivityThread.java:7898)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)

Ive no idea whats going on ?

We are seeing this error with the companion app as well