-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Crash: java.lang.IndexOutOfBoundsException #47
Comments
Interesting. I wouldn't think that could happen.... One things to try is to make a copy of the skuDetailsList to ensure that no one else is messing with it from another thread or something, but it seems like a very unlikely thing to happen. Very wild guess but it could be someone hacking your game... |
I suppose that is possible. It's less than 0.01% of the players, so perhaps it's not worth investigating this any further. This just happened to be the one crash which had a useful stack trace. |
It might be worth looking into still! My recommendation of copying the list before checking size and getting the first item should be a quick way of ensuring that nothing is tampering with the list in between those two lines of code. |
If that's the issue, then that might just as well happen while you're copying the data, right? Is there a recommended way of doing this? E.g. is there an example app from Google which we could adopt best practices from? Perhaps we're using an old recommended way? |
Good point! Here's the official example from Google: Things to note: We only care about the first result, hence the get(0). BUT maybe we should use a |
I've seen this crash recently in the Play Console. Only 12 occurrences and 10 users, thankfully.
Devices are a mix of random Chinese phones & low end Samsung & Nokia. Android 8.1, 9, 10, 11.
All of these crashes occurred on the Instant release, so maybe it's something Google screwed up in their wrapping code.
The issue seems to be here:
https://github.com/defold/extension-iap/blob/master/extension-iap/src/java/com/defold/iap/IapGooglePlay.java#L343-L344
Kind of odd that
Get(0)
would fail after theif
statement does null & empty checks.The text was updated successfully, but these errors were encountered: