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

Crash on Android using Unity IAP

Discussion in 'Unity IAP' started by Antony-Blackett, Apr 16, 2018.

  1. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I'm getting a few reports of a null reference exception. Images are screens from my performance reporting dashboard.

    Any ideas?

    Screen Shot 2018-04-16 at 1.17.28 PM.png Screen Shot 2018-04-16 at 1.17.15 PM.png
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are investigating a possible scenario where the Google play service becomes unbound. Do you have any additional information from the stack trace?
     
  3. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Nope, thats all the info i get through performance reporting.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are all the reports identical? Are they all on Android 5 for example?
     
  5. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Seems so

    Maybe they're an IAP hacker or something? Screen Shot 2018-04-17 at 9.46.52 AM.png
     
  6. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi @Antony-Blackett ,
    Did you call Destroy() to destroy some game objects?
    Unity IAP will create 3 hidden, DontDestroyOnLoad game objects which named IAPUtil, Unity IAP and IAP EventQueue.
    These 3 objects are used to handle IAP actions. You cannot destroy them.
     
  7. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I never knew they existed so no, I don't destroy them.

    Note that this bug has only been reported 10 times on performance reporting and I have 1,500 DAU at the moment.
     
  8. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Oh... I think I may know where it came from. I think these 10 issue reports might be the Google Play automated testing robots. I'm not sure how they manage it but they can get Unity to have null references in some strange places, at least that's my guess anyway. I remember a month or so ago when I first started debugging issues through performance reporting I was getting another null reference exception that made absolutely no sense. Eventually I realised that I only got more reports (exactly 10) when I uploaded a new build to google play.

    I'll let you know if I get any more reports of that and can rule out those google tester bots.