googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.37k stars 1.08k forks source link

Crash with java.lang.NullPointerException on initialize on Android #3436

Closed tomurtogu closed 3 months ago

tomurtogu commented 3 months ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Google Play Console pre-launch reports shows crash on two specific devices. Unable to update apps due to crashes related to Google Mobile Services v24.20.13

Steps to reproduce:

1- Include the Google Mobile Ads SDK to a Unity project. 2- Call MobileAds.Initialize() 3- Start Internal testing in Google Play Console

The crash also occurs in the blank project with Google Mobile Ads included. Min API 25 and Target API 33. Increasing the target api to 34 has not made a change.

Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference at android.os.Parcel.createExceptionOrNull (Parcel.java:3189) at android.os.Parcel.createException (Parcel.java:3167) at android.os.Parcel.readException (Parcel.java:3150) at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:202) at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:154) at android.content.ContentProviderProxy.call (ContentProviderNative.java:764) at android.content.ContentResolver.call (ContentResolver.java:2466) at android.content.ContentResolver.call (ContentResolver.java:2446) at ekfr.a (:com.google.android.gms@242013038@24.20.13 (190400-633713831):29) at com.google.android.gms.wallet.intentoperation.setupwizard.PaymentsSetupWizardAccountChangeIntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):252) at com.google.android.chimera.IntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):2) at ajdw.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):8) at pbh.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):70) at pbg.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):152) at elbx.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):21) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644) at java.lang.Thread.run (Thread.java:1012)

gpgames commented 3 months ago

Hi there,

I'm experiencing the same issue in my Android Studio project. The error extends beyond Unity or Android Studio; it's a Google issue. In the pre-launch video sent to me after testing my app, I noticed that when the tester clicked on a TikTok banner, a popup dialog appeared, stating that Google Mobile Services needed to be installed or updated.

This indicates that the error is not related to our projects or the development tools we use.

Have made numerous changes trying to resolve the issue, including changing Gradle versions, API levels, and dependencies, but to no avail.

I will investigate how to exclude Google Pixel 8 device. Please let me know if you have news.

Thanks

tomurtogu commented 3 months ago

Hi, I also noticed that Google Mobile Services on Google's test devices needs to be updated. I also tried many setups but it made no difference. Excluding Google Pixel 8 from the device catalog doesn't help either, Google is still testing on this device.

I reported this issue to Google Play and got a reply. I think they will come up with a solution. Here's their reply: Our team needs some more time to investigate this issue for you. A technical specialist will reach out to you as soon as possible. Please expect to hear from them soon.

EddyLwei commented 3 months ago

Also noticed that Google issue . [ com.google.android.gms.wallet.intentoperation.setupwizard.PaymentsSetupWizardAccountChangeIntentOperation.onHandleIntent ] so I try 2 update : 'com.android.billingclient:billing:6.2.1'

GauravCreed commented 3 months ago

@EddyLwei issue is not getting from google play billing library, i got same issue from goole play console open testing pre-launch report,

Google is testing our application in automation way with crawl, I think in real device we didn't face any type of this issue.as per @tomurtogu comment above google is still investigating, let's wait until google response. Thanks.

tomurtogu commented 3 months ago

@GauravCreed I got the following response from Google 2 hours ago: "Unfortunately, we don't interpret crashes and ANRs in developer app's pre-launch reports. For more information on how to interpret these reports, please refer to our Understand your pre-launch report on the help center page. For help with technical questions related to app development, I recommend visiting our developer site here. Here you can find links to developer support forums and IRC chat communities where developers help each other solve development-related issues..."

Obviously this answer didn't help much, so I had no choice but to test whether the problem would show up in production. My app just passed the review and went live.

GauravCreed commented 3 months ago

So @tomurtogu and @EddyLwei as per google response, there is no other way to get trace this issue, and also not affect on application crash so my opinion is to leave as it is.

tomerpetel commented 3 months ago

I'm not using Google Play billing at all and having this issue as well... looks like a bug from Google

gpgames commented 3 months ago

Obviously this answer didn't help much, so I had no choice but to test whether the problem would show up in production. My app just passed the review and went live.

Hi @tomurtogu Were you able to see new reports in production about the issue?

Thanks Willy

clunyes commented 3 months ago

@GauravCreed I got the following response from Google 2 hours ago: "Unfortunately, we don't interpret crashes and ANRs in developer app's pre-launch reports. For more information on how to interpret these reports, please refer to our Understand your pre-launch report on the help center page. For help with technical questions related to app development, I recommend visiting our developer site here. Here you can find links to developer support forums and IRC chat communities where developers help each other solve development-related issues..."

Obviously this answer didn't help much, so I had no choice but to test whether the problem would show up in production. My app just passed the review and went live.

try again and again?

efstathiosntonas commented 3 months ago

our app just got rejected due to this bug that exists only on pre-launch report. We're testing against a farm of 50 android devices and none of them encountered this issue.

gzjaychen commented 3 months ago

same problem