Crash on Android with NullPointerException

Hi there!

As the title suggests I am having trouble with a NullPointerException in the GooglePlayStoreHelper class on some Android devices. I am using the blueprint functions for in-app purchases and so far the system worked like a charm and I already got multiple successful in-app purchases. However I noticed in the GooglePlayConsole that there are quiet a lot (30 out of 1600) devices crashing with the following stack trace:


java.lang.NullPointerException:

at com.epicgames.ue4.GooglePlayStoreHelper$c.a (Unknown Source:35)

at com.android.billingclient.api.BillingClientImpl.a (Unknown Source:9)

at com.epicgames.ue4.GooglePlayStoreHelper.a (Unknown Source:99)

at com.epicgames.ue4.GameActivity$w.run (Unknown Source:12)

at android.os.Handler.handleCallback (Handler.java:883)

at android.os.Handler.dispatchMessage (Handler.java:100)

at android.os.Looper.loop (Looper.java:237)

at android.app.ActivityThread.main (ActivityThread.java:8167)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)


Now I know that this is not much but does anybody have any idea what could be causing that or at least point me in some direction? I have already double checked that I do give all the functions valid references to the player controller and product identifiers. If you need any additional information I will try to provide it.

Thanks
Justus

Hi there!
Does nobody have any idea or hint? The problem is I am not even sure if the problem is somewhere in my blueprints or somewhere in the provided blueprint functions.
Thanks

I have also this problem in UE4.26

In version 4.24 I had no problem with this

java.lang.NullPointerException:

at com.epicgames.ue4.GooglePlayStoreHelper$d.a (GooglePlayStoreHelper.java:3)

at com.android.billingclient.api.c.f

at com.epicgames.ue4.GooglePlayStoreHelper.c (GooglePlayStoreHelper.java:10)

at com.epicgames.ue4.GameActivity$z.run (GameActivity.java:1)

at android.os.Handler.handleCallback (Handler.java:883)

at android.os.Handler.dispatchMessage (Handler.java:100)

at android.os.Looper.loop (Looper.java:237)

at android.app.ActivityThread.main (ActivityThread.java:7948)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1075)

Have you solved the problem?
What are your project settings?
Minimum Version SDK,
Target SDK Version,
SDK API Level,
NDK API Level,
NDK Version

Hey ForgeGames. I have not yet been able to solve this problem. The min sdk version is 21 and the target is 29. The SDK API Level is set to ‘latest’ and the NDK API Level is ‘android-19’. The NDK Version is 21.1.6352462

Hi. You are using bUseStoreV2 or V1?

are you using third party plugins? and which ones, if yes?

I am using the V2 functions and the bUseStoreV2 is set to true in the AndroidEngine.ini. I am not using any third party plugins.

Did anyone resolve this issue in the meantime? I am running into this as well :confused:

Unfortunately, no. I basically abandoned the project because I was simply not able to get it working.

you need to edit it GooglePlayStoreHelper.java, because the Epics made a mistake there.
you need to add the check “skuDetailsList! = null”

I have attached the corrected file for version 4.26
[1]: 345706-googleplaystorehelper.txt (27.5 KB)

Thanks a lot for that hint! This sounds like it really could solve the issue. Will give it a try :slight_smile: