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

Android crashes on startup "Bad magic number for Bundle: 0x2"

Discussion in 'Unity IAP' started by andrew-fray, Sep 10, 2018.

  1. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    Hi folks,

    Purchasing is working internally, and the game is shipped and we're getting purchases in the wild.

    However we've had one complaint that the game consistently crashes on boot. From the device log, I can see it crashed because of an exception in unity's IAP service:

    Code (JavaScript):
    1.  java.lang.IllegalStateException: Bad magic number for Bundle: 0x2
    2.      at android.os.Parcel.createException(Parcel.java:1950)
    3.      at android.os.Parcel.readException(Parcel.java:1910)
    4.      at android.os.Parcel.readException(Parcel.java:1860)
    5.      at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupportedExtraParams(IInAppBillingService.java:756)
    6.      at com.unity.purchasing.googleplay.IabHelper.finishSetup(IabHelper.java:314)
    7.      at com.unity.purchasing.googleplay.IabHelper.access$000(IabHelper.java:76)
    8.      at com.unity.purchasing.googleplay.IabHelper$1.workWith(IabHelper.java:267)
    9.      at com.unity.purchasing.googleplay.BillingServiceManager$2.run(BillingServiceManager.java:146)
    10.      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    11.      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    12.      at java.lang.Thread.run(Thread.java:764)
    13.  
    Anyone have any idea what's happening here? How to stop the user's device crashing? We're on Unity 2017.4.5, and "an update is available for IAP service" but the services menu doesn't tell me what my current version is.
     
  2. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    138
    Hi even we too got the same crash today.Crash occurred in oneplus3( OnePlus ONEPLUS A3003) OREO today.My unity version is 5.6.3.
    Code (CSharp):
    1. Caused by java.lang.IllegalStateException: Bad magic number for Bundle: 0x2
    2.        at android.os.Parcel.readException(Parcel.java:1951)
    3.        at android.os.Parcel.readException(Parcel.java:1889)
    4.        at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupportedExtraParams(IInAppBillingService.java:756)
    5.        at com.unity.purchasing.googleplay.IabHelper.finishSetup(IabHelper.java:335)
    6.        at com.unity.purchasing.googleplay.IabHelper.access$000(IabHelper.java:76)
    7.        at com.unity.purchasing.googleplay.IabHelper$1.workWith(IabHelper.java:277)
    8.        at com.unity.purchasing.googleplay.BillingServiceManager$2.run(BillingServiceManager.java:146)
    9.        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    10.        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    11.        at java.lang.Thread.run(Thread.java:764)
     
  3. TheWulo

    TheWulo

    Joined:
    Nov 16, 2014
    Posts:
    5
    We've got the same problem. Unity: 2017.4.5f1, Device: Google Pixel XL.

    Code (CSharp):
    1.  Caused by java.lang.IllegalStateException: Bad magic number for Bundle: 0x2
    2.        at android.os.Parcel.readException(Parcel.java:2013)
    3.        at android.os.Parcel.readException(Parcel.java:1951)
    4.        at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupportedExtraParams(IInAppBillingService.java:756)
    5.        at com.unity.purchasing.googleplay.IabHelper.finishSetup(IabHelper.java:273)
    6.        at com.unity.purchasing.googleplay.IabHelper.access$000(IabHelper.java:75)
    7.        at com.unity.purchasing.googleplay.IabHelper$1.workWith(IabHelper.java:238)
    8.        at com.unity.purchasing.googleplay.BillingServiceManager$2.run(BillingServiceManager.java:133)
    9.        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    10.        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    11.        at java.lang.Thread.run(Thread.java:764)
    Our App Crashes Right after booting the loading screen.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are currently investigating. Were these apps working previously up until a particular date? If you are able to reproduce, please provide the device logs
     
  5. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    138
    Happend in Galaxy J7 Prime (on7xelte) Android 7.0 aswell. Looks like crash rate increasing.First encountered on 9 Sept 2018 and crashed on new device on 10 Sep 2018.Please shed some light.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    With all else being equal, and with no recent changes to your game, this would point to an issue on the Google servers. We are continuing to research here.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @andrew-fray @sandeepsmartest @TheWulo We have not been able to reproduce, are you still seeing the issue? What version of IAP are you using? You can confirm the IAP version by the opening changelog file located in Assets/Plugins/UnityPurchasing or in recent versions of Unity, navigate in the Editor to Window/Unity IAP/IAP Updates
     
  8. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    We've had one report so far. It came in on the 8th. We've got v1.19 of Unity IAP installed. We have a device log from the user, I'll try to DM it to you.
     
  9. unity_MfhQq8HxDUKu3g

    unity_MfhQq8HxDUKu3g

    Joined:
    Sep 11, 2018
    Posts:
    1
    I'm not familiar with Unity, but I know my way around logcat well enough to know that I have a consistent repro of this issue in a game I play (Sumikko Gurashi: Puzzling Ways). So ping me if I can help somehow.
     
  10. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    138
    My Unity Version is 5.6.3, also occurred in 2017.4.10f1
    IAP Version : 1.20.0
    compileSdkVersion 26
    buildToolsVersion '26.0.0'
    Count Increased to 3 users: Crash found in another new device Lenovo VIBE K6 Power (K33a42), Android 7.0.
    Check out the screenshot attached.
     

    Attached Files:

  11. Deleted User

    Deleted User

    Guest

    Hi, I'd like to add to this:

    We're seeing some crashes of this type as well. So far we have 41 crashes since 4 days.

    Example stacktrace:

    Fatal Exception: java.lang.Error: FATAL EXCEPTION [pool-18-thread-1]
    Unity version : 2017.3.1p1
    Device model : Google Pixel
    Device fingerprint: google/sailfish/sailfish:9/PPR2.180905.006/4945130:user/release-keys


    Caused by java.lang.IllegalStateException: Bad magic number for Bundle: 0x2
    at android.os.Parcel.createException(Parcel.java:1950)
    at android.os.Parcel.readException(Parcel.java:1910)
    at android.os.Parcel.readException(Parcel.java:1860)
    at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupportedExtraParams(IInAppBillingService.java:756)
    at com.unity.purchasing.googleplay.IabHelper.finishSetup(IabHelper.java:273)
    at com.unity.purchasing.googleplay.IabHelper.access$000(IabHelper.java:75)
    at com.unity.purchasing.googleplay.IabHelper$1.workWith(IabHelper.java:238)
    at com.unity.purchasing.googleplay.BillingServiceManager$2.run(BillingServiceManager.java:133)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)


    More Info can be found here http://crashes.to/s/490ac7d9567

    Unity IAP version is 1.16.0

    Feel free to DM me if you need more info.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are still investigating, but haven't been able to reproduce. Have you opened an support incident with Google? Has anyone been able to reproduce yet?
     
  13. devonsmith20478

    devonsmith20478

    Joined:
    Nov 15, 2012
    Posts:
    4
    Hi, we have also a similar error on our app. Only thing I can tell is we are using subscriptions and using UNITY IAP version 1.20. IMG_11092018_101112_0.png This happens on app launch and after this issue app stops working forever.
     
  14. pikkugergely

    pikkugergely

    Joined:
    Jun 15, 2015
    Posts:
    6
    We have the same problem starting from 6th September. The overwhelming majority (about 75%) of these crashes happens on Android 9 (and predominantly Pixel and Pixel 2 phones), and almost all the others come from Android 8. However, even this is just a small fraction of our Android 9 users active during the same period, maybe around 3%. It started breaking without us making any changes, so it's clearly something that Google did on their end; maybe caused by an OS update.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    My suspicion is a single bad server configuration in one of their server farms. This would explain the seemingly random occurrence of this issue. You will want to open a support ticket with Google.
     
  16. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    @JeffDUnity3D I'm not trying to be awkward, but we use unity's plugin because there's a certain expectation of quality and service. This issue may or may not be in unity's plugin, but we talk to google's IAP service _through that_, and there are many customers here complaining, so it doesn't seem entirely unreasonable for unity to be the one filing the ticket, and keeping everyone up to date.
     
  17. pikkugergely

    pikkugergely

    Joined:
    Jun 15, 2015
    Posts:
    6
    I just checked some of the crashes, and they seem to coincide with the users getting a system update with very recent security patches (published 5-6th September). Versions like PPR2.180905.005 and OPM6.171019.030.K1 turn up.
     
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Ah, that is a very good clue https://www.droid-life.com/2018/09/...ity-update-goes-live-for-nexus-pixel-devices/ . I mentioned this to the engineering team here, hopefully we will be able to reproduce and address the issue now.
     
  19. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I understand your point of view, but operation teams generally do not like to hear second-hand reports from other vendors like us. We've tried to go down that road before. They need to talk directly to those users affected. But this may be a non-starter discussion as I'm hoping we've identified the issue as a recent security update from Google. That is something that we at Unity CAN look into!
     
  20. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    155
    That's a more understandable position. But then we're also not the users directly affected, we're just relaying some logs from those that _are_.

    FWIW our affected player says the crashes have stopped as of the 11th.
     
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @andrew-fray Your point is taken. And thanks for the heads up! We tested here within the last 24 hours on a Pixel device and didn't see the issue either, hoping for the best.