Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75906

[Android] NullPointerException at QtInAppPurchase.java:240 & QtInAppPurchase.java:166

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 5.15
    • 5.12.3, 5.12.9, 5.15.0
    • Purchasing
    • Huawei devices running Android 8 & Samsung devices running Android 9
    • Android
    • 2022wk38FOQtforAndroid

      In my Google Play console I noticed a lot of crashes that point to:

      java.lang.NullPointerException: 
       at org.qtproject.qt5.android.purchasing.QtInAppPurchase$2.run (QtInAppPurchase.java:240)
       at java.lang.Thread.run (Thread.java:784)

      Almost all of these crashes happen on Huawei devices.

      Recently I've integrated Firebase Crashlytics and I've noticed another crash that points to the same issue:

      Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.Bundle com.android.vending.billing.IInAppBillingService.getPurchases(int, java.lang.String, java.lang.String, java.lang.String)' on a null object reference
             at org.qtproject.qt5.android.purchasing.QtInAppPurchase.queryPurchasedProducts(QtInAppPurchase.java:166)
             at org.qtproject.qt5.android.purchasing.QtInAppPurchase.access$200(QtInAppPurchase.java:52)
             at org.qtproject.qt5.android.purchasing.QtInAppPurchase$1$1.run(QtInAppPurchase.java:99)
             at java.lang.Thread.run(Thread.java:764)
      

      This new crash mainly impacts Samsung devices running Android 9.
       

        1. Qt5123_NullPointerException_QtInAppPurchase.JPG
          103 kB
          Adrian Gabureanu
        2. Qt5150_NullPointerException_QtInAppPurchase.JPG
          84 kB
          Adrian Gabureanu
        3. QtInAppPurchase(FIX).java
          21 kB
          Adrian Gabureanu
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jani-korteniemi Jani Korteniemi
            adrian.gabureanu Adrian Gabureanu
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes