When our users try to open our IAP view, which calls “UnityPurchasing.Initialize”, the screen turns black and the app crashes short after.
This is apparently only happening to Sony XPeria users. The Android version doesn’t matter, as we get reports in the Google Play Developer console for multiple Android versions.
This is the error we can see in the Google Play Developer:
java.lang.Error: FATAL EXCEPTION [AsyncQueryWorker]
Unity version : 5.6.0f3
Device model : Sony D2303
Caused by
at android.os.Parcel.readException(Parcel.java:1465)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:468)
at android.content.ContentResolver.insert(ContentResolver.java:1190)
at android.content.AsyncQueryHandler$WorkerHandler.handleMessage(AsyncQueryHandler.java:96)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Sadly we can’t make a log or reproduce this exception, because we only see this in the Google Developer Console and when we hear from users who can’t use IAP.
I’m not entirely sure which version of IAP we used in this build, but I think it was about two updates ago. Maybe that helps you to narrow it down a little.
Here are some of the Xperia devices we got reports from:
Xperia Z5 (E6653)
Xperia XZ (F8331)
Xperia Z5 Compact (E5823),
Xperia™ M4 Aqua (E2303)
Xperia Z (C6603)
Xperia XA (F3111)
Xperia Z1 (C6903)
Xperia™ M4 Aqua Dual (E2363)
Xperia XZ (F8332)
Xperia Z3 (D6603)
Xperia E5 (F3311)
Xperia XA (F3116)
Xperia X Compact (F5321)
Xperia X (F5121)
Xperia XA (F3113)
Xperia M2 (D2303)
Xperia X Performance (F8131)
Xperia Z5 dual (E6683)
Xperia Z2 (D6503)
Xperia Z3+ (E6553)
Here is the full stack of the error in the Google Play Dashboard:
java.lang.Error: FATAL EXCEPTION [AsyncQueryWorker]
Unity version : 5.6.2p2
Device model : Sony D5803
Device fingerprint: Sony/D5803/D5803:6.0.1/23.5.A.1.291/2769308465:user/release-keys
Caused by
at android.os.Parcel.readException (Parcel.java:1627)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:135)
at android.content.ContentProviderProxy.insert (ContentProviderNative.java:482)
at android.content.ContentResolver.insert (ContentResolver.java:1240)
at android.content.AsyncQueryHandler$WorkerHandler.handleMessage (AsyncQueryHandler.java:96)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:234)
at android.os.HandlerThread.run (HandlerThread.java:61)
It seems to be the same error. As they say in the stack overflow subject, it seems to be related to the fact that you are calling something that is not available in the android version used by the phone. Please can you look at this problem???
Our game handle permissions asking. When we launch the game we ask for the critical permissions (WRITE_EXTERNAL, COARSE_LOCATION and READ_PHONE_STATE). Before using Unity IAP we were using OpenIAB but it was kind of buggy, so we rewrote our entire IAP system to use yours.
We have almost the same stack trace that the owner of the subject, some lines are differents but the symptoms are the same. All Sony phones affected. At this moment we can’t confirm what exactly is happening because no user reported a particular problem and we have no problems when running on Sony Tablet SGP621 (XPERIA TABLET Z3 COMPACT).
As we have no other Sony device, we really don’t know what’s happening, but we have already 500 reports on Android Vitals that print the same error below and it begans exactly when we released the update including IAP
@r-pedra The article shows some explicit runtime code that you can call that confirms that those permissions are in place, are you able to test? My suspicion is that the OS on Xperia devices isn’t recognizing those settings, can you confirm?
Do you want me to create a test app that run this code? The problem is that we don’t have a device that have the bug so it will be pointless. Do you have any of the devices below?
I tested on an Xperia SGP311 and an Xperia LT26w with no issues, although they don’t have external storage. The phone does have a Micro SD card slot, I will test again in the next day or so and provide my results. In the meantime, if any user on here has an affected device to test with, please test with the code mentioned here xml - Download Manager Android Permissions error: write external Storage - Stack Overflow
We have bought 2 Xperia too, Xperia M and Xperia XA Dual and we are not able to find the bug. We don’t have SD card to test but we didn’t encoutered any problem. The thing is that we now have more than 1000 thousand reports in Android Vitals and we still can’t figure how to have this crash. I think with this amount, that the crash does not occurs when buying an item (as we don’t have this amount of Xperia buying things usually) and I think that the app does not quit as we don’t have any report from our users that there is a problem.
The fact is that Android Vitals is now a part of the ranking of an app, “Crashes” (as Android Vitals calls this) increased by more than 200% and that is not acceptable on our side.
I know it seems to be something hard to find but these figures shows that it occurs on many devices, and it should not be ignored because it’s decreasing ranking of apps.
If you have any news, please tell us.
The few users that reported the issue directly to us had problems with opening our IAP view, which loads the standard code for Unity IAP.
Maybe this helps with looking for the issue.