Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Closed] App crashes on Sony Xperia only

Discussion in 'Unity IAP' started by Nyankoooo, May 29, 2017.

Thread Status:
Not open for further replies.
  1. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    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:

    Code (CSharp):
    1. java.lang.Error: FATAL EXCEPTION [AsyncQueryWorker]
    2. Unity version : 5.6.0f3
    3. Device model : Sony D2303
    4. Caused by
    5. at android.os.Parcel.readException(Parcel.java:1465)
    6. at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
    7. at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
    8. at android.content.ContentProviderProxy.insert(ContentProviderNative.java:468)
    9. at android.content.ContentResolver.insert(ContentResolver.java:1190)
    10. at android.content.AsyncQueryHandler$WorkerHandler.handleMessage(AsyncQueryHandler.java:96)
    11. at android.os.Handler.dispatchMessage(Handler.java:106)
    12. at android.os.Looper.loop(Looper.java:136)
    13. at android.os.HandlerThread.run(HandlerThread.java:61)
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @MardukCorp

    Our QA team will take a look and do some more testing with XPeria devices. Here is the bug ticket: https://fogbugz.unity3d.com/default.asp?916606_ds9nhb2q

    Would you be able to provide some more details about this issue?
    • Would you be able to get a log from a device experiencing this issue?
    • What version of the plugin was this app developed with?
    • Would you be able to provide a sample project where this issue is occurring?
     
    Last edited: May 31, 2017
  3. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    @ap-unity

    Thank you for your reply!

    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)
     
  4. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    @ap-unity We just tested with one of our users the newest version of Unity IAP, but it still crashes.
     
  5. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @MardukCorp

    Sorry, there are no updates. We are still looking into this.
     
  7. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @MardukCorp

    Would you be able to provide a link to your app for testing?
     
  8. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
  9. shendyaprianto

    shendyaprianto

    Joined:
    Feb 28, 2014
    Posts:
    1
    Hi

    i got this error too.
    report from google play :

    Xperia Z (C6603) 52 12.5%
    Xperia Z3 Compact (D5833) 49 11.8%
    Xperia Z2 (D6503) 31 7.5%
    Xperia Z Ultra (C6833) 29 7.0%
    Xperia C5 Ultra Dual (E5533) 26 6.3%
    Xperia Z3 (D6653) 26 6.3%
    Xperia Z3+ (E6553) 25 6.0%
    Xperia M2 (D2305) 19 4.6%
    Xperia Z1 Compact (D5503) 18 4.3%
    Xperia M5 Dual (E5663) 16 3.8%
    Xperia™ C4 Dual (E5333) 14 3.4%
    Xperia ZR (C5503) 12 2.9%
    Xperia™ E4 Dual (E2115) 11 2.6%
    Xperia Z1 (C6903) 11 2.6%
    Xperia Z5 dual (E6683) 9 2.2%
    Xperia Z2 (SO-03F) 8 1.9%
    MI 3W (cancro) 7 1.7%
    Xperia Z5 Compact (E5803) 7 1.7%
    Xperia™ M4 Aqua (E2353) 6 1.4%
    Xperia M2 dual (D2302) 6 1.4%
    Others 34 8.2%

    any update about this?
     
  10. closeapps

    closeapps

    Joined:
    May 24, 2016
    Posts:
    3
    Hi,
    I got the same error with many devices:
    Xperia XA Ultra (F3213) 9 9,9%
    Xperia Z3+ (E6553) 9 9,9%
    Xperia C3 Dual (D2502) 9 9,9%
    Xperia XA (F3113) 7 7,7%
    Xperia E4g Dual (E2043) 7 7,7%
    Xperia Z2 (SO-03F) 6 6,6%
    Xperia Z2 (D6502) 6 6,6%
    Xperia Z5 Premium Dual (E6833) 5 5,5%
    Xperia Z2 (D6503) 4 4,4%
    Xperia T2 Ultra (D5322) 4 4,4%
    Xperia XA Ultra (F3212) 3 3,3%
    Xperia M5 Dual (E5633) 3 3,3%
    Xperia™ C4 Dual (E5363) 3 3,3%
    Xperia™ E4 Dual (E2124) 3 3,3%
    Xperia Z3 (D6603) 3 3,3%
    Xperia X (F5122) 2 2,2%
    Xperia Z3 Compact (D5833) 2 2,2%
    Xperia Tablet Z (SGP321) 1 1,1%
    Xperia C5 Ultra Dual (E5533) 1 1,1%
    Xperia™ C4 (E5353) 1 1,1%

    Here is the link to my app if you want to test:
    https://play.google.com/store/apps/details?id=com.closeapps.mathrun

    I need a fix please,
    Thanks.
     
  11. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
  12. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    @ap-unity @nicholasr
    I have found informations about this crash that maybe can help you solve this:
    https://stackoverflow.com/questions...roid-permissions-error-write-external-storage

    Here is the full stack of the error in the Google Play Dashboard:
    Code (CSharp):
    1. java.lang.Error: FATAL EXCEPTION [AsyncQueryWorker]
    2. Unity version     : 5.6.2p2
    3. Device model      : Sony D5803
    4. Device fingerprint: Sony/D5803/D5803:6.0.1/23.5.A.1.291/2769308465:user/release-keys
    5. Caused by
    6.   at android.os.Parcel.readException (Parcel.java:1627)
    7.   at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:183)
    8.   at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:135)
    9.   at android.content.ContentProviderProxy.insert (ContentProviderNative.java:482)
    10.   at android.content.ContentResolver.insert (ContentResolver.java:1240)
    11.   at android.content.AsyncQueryHandler$WorkerHandler.handleMessage (AsyncQueryHandler.java:96)
    12.   at android.os.Handler.dispatchMessage (Handler.java:102)
    13.   at android.os.Looper.loop (Looper.java:234)
    14.   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???
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @r-pedra Have you been able to confirm that you have the correct permissions, as mentioned in the first answer in the article?
     
  14. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Hi,
    We have all these permissions:
    Code (CSharp):
    1. <uses-permission android:name="android.permission.INTERNET" />
    2.     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    3.     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    4.     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    5.     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    6.     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    7.     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    8.     <uses-permission android:name="android.permission.VIBRATE" />
    9.     <uses-permission android:name="com.android.vending.BILLING" />
    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
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @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?
     
  16. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    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?
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We have obtained an Xperia device to test on, I should have results early next week.
     
    r-pedra and Nyankoooo like this.
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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 https://stackoverflow.com/questions...roid-permissions-error-write-external-storage
     
  19. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    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.
     
  20. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    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.
     
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @r-pedra Yes, you will want to also test with a micro-sd card. I'm doing the same thing here. Keep in mind that in order to address an issue, we first have to reproduce it here, otherwise there is no action we can take, nor is there any way to test any potential fix.
     
  22. Seans

    Seans

    Joined:
    Apr 20, 2013
    Posts:
    2
    Same for ours.
    upload_2017-10-4_23-24-32.png

    Today, 9:10 PM on app version 37
    Sony Xperia Z1 Compact (D5503), 2048MB RAM, Android 4.4
    Report 1 of 304

    java.lang.Error: FATAL EXCEPTION [AsyncQueryWorker] Unity version : 5.6.1p4 Device model : Sony D5503 Device fingerprint: Sony/D5503/D5503:4.4.4/14.4.A.0.157/Yv__jQ:user/release-keys Caused by

    at android.os.Parcel.readException (Parcel.java:1474)

    at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:185)

    at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:137)

    at android.content.ContentProviderProxy.insert (ContentProviderNative.java:479)

    at android.content.ContentResolver.insert (ContentResolver.java:1196)

    at android.content.AsyncQueryHandler$WorkerHandler.handleMessage (AsyncQueryHandler.java:96)

    at android.os.Handler.dispatchMessage (Handler.java:102)

    at android.os.Looper.loop (Looper.java:212)

    at android.os.HandlerThread.run (HandlerThread.java:61)
     
  23. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Do you have a device to test on? The 2 Xperia devices that we have here for testing (so far) do not experience the issue (and are not in the list). And you might notice that the errors are in the OS and not in the Unity code. We suspect that this may be an Xperia issue. There is likely not much we can do, but we are continuing to investigate. My suspicion is these devices may be trying to write to external storage. In the previous article, it discusses the following permissions:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    You could Export the build in Unity and manually add these settings. Under File/Build Settings, you would choose Gradle as the Build System and then select the Export project checkbox. You could then directly edit the manifest file and explicitly add these permissions and build the apk. This has NOT been tested as we do not have a device here yet in the list to test with.
     
    Last edited: Oct 5, 2017
  24. Seans

    Seans

    Joined:
    Apr 20, 2013
    Posts:
    2
    Thanks for the advice. We will get an xperia and give it a try. I think the worst case scenario is we blacklist these devices :)
     
  25. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
  26. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We don't believe this to be a Unity IAP issue at this point. The exception does not look to be within our code.
     
  27. BrianND

    BrianND

    Joined:
    May 14, 2015
    Posts:
    79
    We are expriencing the same issue. We don't use Unity IAP. High percentage of crashes are Xperia only.
     
Thread Status:
Not open for further replies.