RevenueCat / purchases-android

Android in-app purchases and subscriptions made easy.
https://www.revenuecat.com/
MIT License
260 stars 53 forks source link

NullPointerException on com.google.android.gms.ads.identifier.AdvertisingIdClient$Info.isLimitAdTrackingEnabled() #1548

Open matteinn opened 10 months ago

matteinn commented 10 months ago

Describe the bug A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

Here's the stacktrace of a crash found from production users:

java.lang.NullPointerException (crashed)
Attempt to invoke virtual method 'boolean com.google.android.gms.ads.identifier.AdvertisingIdClient$Info.isLimitAdTrackingEnabled()' on a null object reference
com.revenuecat.purchases.google.attribution.GoogleDeviceIdentifiersFetcher.getAdvertisingID (Unknown Source:51)
com.revenuecat.purchases.google.attribution.GoogleDeviceIdentifiersFetcher.getDeviceIdentifiers$lambda$0 (Unknown Source:15)
com.revenuecat.purchases.google.attribution.GoogleDeviceIdentifiersFetcher.a (Unknown Source)
com.revenuecat.purchases.google.attribution.GoogleDeviceIdentifiersFetcher$$InternalSyntheticLambda$1$05e72c584e33dbd09bb60a652b02f5f9134b2cad99e8820e073032a93bb4cf4f$0.run (Unknown Source:5)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:462)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:301)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:923)
  1. Environment
    1. Platform: Android
    2. SDK version: 6.9.5
    3. OS version: 11
    4. Android Studio version: not relevant
    5. How widespread is the issue. Percentage of devices affected. < 0.01%
  2. Debug logs that reproduce the issue: not available
  3. Steps to reproduce, with a description of expected vs. actual behavior: not available
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.) Seems to be only happening on LGE Nexus 5X devices running Android 11

Additional context Add any other context about the problem here.

RCGitBot commented 10 months ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

tonidero commented 10 months ago

Thanks for reporting this @matteinn. We haven't been able to reproduce, but we've seen other similar reports related to the google ads library. We're working on a fix in #1550. Will let you know once we confirm and ship the fix!

matteinn commented 10 months ago

Many thanks @tonidero, makes sense to me!