# Crash on Android with NullPointerException

**URL:** <https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537>\
**Category:** Mobile\
**Tags:** in-app-purchase, unreal-engine, Android, java, question\
**Created:** [March 18, 2021, 10:08pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537 "2021-03-18T22:08:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![justus10000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@justus10000](https://forums.unrealengine.com/u/justus10000)\
**Post date:** [March 18, 2021, 10:08pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/1 "2021-03-18T22:08:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![justus10000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@justus10000](https://forums.unrealengine.com/u/justus10000)\
**Post date:** [April 1, 2021, 5:07pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/2 "2021-04-01T17:07:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ForgeGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forgegames/32/1107614_2.png) [@ForgeGames](https://forums.unrealengine.com/u/ForgeGames)\
**Post date:** [April 4, 2021, 11:37am UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/3 "2021-04-04T11:37:09Z")

</div>

**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)

---

<div class="post-metadata">

**Author:** ![ForgeGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forgegames/32/1107614_2.png) [@ForgeGames](https://forums.unrealengine.com/u/ForgeGames)\
**Post date:** [April 4, 2021, 12:01pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/4 "2021-04-04T12:01:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![justus10000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@justus10000](https://forums.unrealengine.com/u/justus10000)\
**Post date:** [April 5, 2021, 10:05am UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/5 "2021-04-05T10:05:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ForgeGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forgegames/32/1107614_2.png) [@ForgeGames](https://forums.unrealengine.com/u/ForgeGames)\
**Post date:** [April 5, 2021, 10:58am UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/6 "2021-04-05T10:58:11Z")

</div>

Hi. You are using bUseStoreV2 or V1?

---

<div class="post-metadata">

**Author:** ![ForgeGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forgegames/32/1107614_2.png) [@ForgeGames](https://forums.unrealengine.com/u/ForgeGames)\
**Post date:** [April 5, 2021, 4:50pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/7 "2021-04-05T16:50:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![justus10000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@justus10000](https://forums.unrealengine.com/u/justus10000)\
**Post date:** [April 7, 2021, 12:47pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/8 "2021-04-07T12:47:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Featuriing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/featuriing/32/1135409_2.png) [@Featuriing](https://forums.unrealengine.com/u/Featuriing)\
**Post date:** [August 5, 2021, 9:51pm UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/9 "2021-08-05T21:51:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![justus10000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@justus10000](https://forums.unrealengine.com/u/justus10000)\
**Post date:** [August 6, 2021, 8:42am UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/10 "2021-08-06T08:42:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ForgeGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forgegames/32/1107614_2.png) [@ForgeGames](https://forums.unrealengine.com/u/ForgeGames)\
**Post date:** [August 6, 2021, 10:01am UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/11 "2021-08-06T10:01:02Z")

</div>

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](https://forums.unrealengine.com/uploads/short-url/eOpgDODH9zcIQS1VUBl8O5UY4aG.txt) (27.5 KB)

---

<div class="post-metadata">

**Author:** ![Featuriing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/featuriing/32/1135409_2.png) [@Featuriing](https://forums.unrealengine.com/u/Featuriing)\
**Post date:** [August 9, 2021, 9:06am UTC](https://forums.unrealengine.com/t/crash-on-android-with-nullpointerexception/480537/12 "2021-08-09T09:06:18Z")

</div>

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