#NPE - Expected to unbox a 'boolean' primitive type but was returned null

1 messages · Page 1 of 1 (latest)

high creek
#

Hi @zenith lotus
Since updating to v2.7.1 from 2.4.1, we are getting very high crash rate due to this particular issue. This has only showed up in last version where I have only updated the kit as per the instructions. Can you look into it and guide us how to fix this issue?

Here is a stack trace:

Exception java.lang.Error: FATAL EXCEPTION [main]
Unity version     : 2020.3.48f1
Device model      : samsung SM-A715F
Device fingerprint: samsung/a71zh/a71:13/TP1A.220624.014/A715FZHU9DWH4:user/release-keys
Build Type        : Release
Scripting Backend : IL2CPP
ABI               : arm64-v8a
Strip Engine Code : true

Caused by: java.lang.NullPointerException: Expected to unbox a 'boolean' primitive type but was returned null
  at $Proxy25.equals
  at java.util.ArrayList.remove (ArrayList.java:631)
  at com.voxelbusters.essentialkit.cloudservices.CloudServices.onSyncronizeFinished
  at com.voxelbusters.essentialkit.cloudservices.CloudServices$b$a.onSuccess
  at com.voxelbusters.essentialkit.cloudservices.CloudServices$c.onComplete
  at com.google.android.gms.tasks.zzi.run (com.google.android.gms:play-services-tasks@@18.0.2:1)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8762)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
zenith lotus
#

Can you please share your implementation once?

high creek
high creek
#

The crash rate has increased significantly, from 0.12% to 2.88%. Due to this rise, we're halting the rollout and reverting to VB version 2.4.1. If you have any suggestions for fixing the issue, please share them.

high creek
#

@zenith lotus can we get any comments on the issue please?

zenith lotus
#

Yes. I was trying to reproduce it but couldn't. May be one specific datatype leading to the issue when getting converted/deserialised.
Can you get me a snapshot of your data in json format so that i can try the exact samething?

high creek
high creek
high creek
#

Hi @zenith lotus the AppStore spring deadline is approaching soon. Any leads on this issue?

zenith lotus
#

@high creek May I know what is the deadline you are talking about?

high creek
high creek
#

Hi @zenith lotus

We are still experiencing a high crash rate related to the same issue (please ignore my Apple-related comments for now as we want to focus on Android first). This time we tried updating to Unity 2022 LTS, but we are still seeing a very high crash rate. One thing that helped was increasing our interval to stop the parallel synchronize calls from 1 second to 60 seconds. I made this change after reading another thread with a slightly different error: <#1229319465217294377 message>

Although we are calling synchronize on events, increasing the interval before making another call has reduced the crashes by half. Despite this reduction, crashes are still occurring in significant numbers. Almost 90% of the crash events are due to this issue.

I wanted to ask if we should try another build with an even longer interval or if there are any other measures we can take to reduce the crashes. Any ideas would be appreciated. Thanks!

#

Here is the stack trace again:

Exception java.lang.Error: FATAL EXCEPTION [main]
Unity version     : 2022.3.27f1
Device model      : Xiaomi M2102J20SG
Device fingerprint: POCO/vayu_ru/vayu:13/TKQ1.221013.002/V14.0.1.0.TJURUXM:user/release-keys
CPU supported ABI : [arm64-v8a, armeabi-v7a, armeabi]
Build Type        : Release
Scripting Backend : IL2CPP
Libs loaded from  : lib/arm64
Strip Engine Code : true

Caused by: java.lang.NullPointerException: Expected to unbox a 'boolean' primitive type but was returned null
  at $Proxy23.equals
  at java.util.ArrayList.remove (ArrayList.java:631)
  at com.voxelbusters.essentialkit.cloudservices.CloudServices.onSyncronizeFinished
  at com.voxelbusters.essentialkit.cloudservices.CloudServices$b$a.onSuccess
  at com.voxelbusters.essentialkit.cloudservices.CloudServices$c.onComplete
  at com.google.android.gms.tasks.zzi.run (com.google.android.gms:play-services-tasks@@18.1.0:1)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:211)
  at android.os.Looper.loop (Looper.java:300)
  at android.app.ActivityThread.main (ActivityThread.java:8272)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:559)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:954)
zenith lotus
#

If it's possible to add manual syncronize that would be great. Due to concurrency issues and to simplify the api, we will be handling the auto sync internally and removing the sync timer for android in V3.

high creek
#

We are calling CloudServices.Synchronize(); manually on important events. But sometimes we reload scene and it gets called multiple time. That's what the interval is trying to resolve.

#

The sync interval in settings is also set to the default 60

zenith lotus
#

set it to 100000

#

As you are syncing manually, you don't need sync timer. This is one of the reasons to remove the sync timer config as it adds extra confusion. Instead if we do it internally when app goes to pause that would be enough - similar to how playerprefs are handled

high creek
high creek
#

Increasing the Sync Interval to 100000 didn't help. Can you suggest any other solution?

We are not getting any complaints from the user and unable to reproduce the crash at our end. As a temporary workaround, would adding a null check help? If so, can you point me where to add it?

zenith lotus
#

Increasing the Sync Interval to 100000 didn't help. Can you suggest any other solution?

We are not getting any complaints from the user and unable to reproduce the crash at our end
I see it a bit conflicting. Did I miss something?

I don't see any other specific reasons for it to fail. But we will revisit this in V3 anyways to make sure multiple calls in parallel also are handled.

high creek
#

Yeah, it is conflicting as it is showing up as a user perceived crash on Play Store. Usually our player make the noise when we rollout the build in open testing but for these builds, no one seems to complaint about crash or data loss. That's why I was thinking about adding some error handling perhaps on the callback OnSynchronizeComplete

#

I don't think it will be useful, but here is some more context. We recently updated to Unity 2022 LTS from Unity 2020 LTS to support Android 34 as the target API level. The build failed with the older Essential Kit 2.4.1 but works with the newer 2.7.1. However, the crash frequency increases significantly with the update to 2.7.1, and we are unable to roll it out completely due to the above-threshold crash rate (it was below 0.2% and crosses the threshold of 1.09% with Essential Kit 2.7.1).

zenith lotus
#

I see.
If you have sync interval to 10k secs, do you have any reports in your closed group?

high creek
#

None so far but Play Store crash rate is hanging around bad behavior threshold with 5% production rollout

high creek
#

@zenith lotus Why does the kit logs so much when I have set the Log Level to Error? It even prints this when Log Level is None.

zenith lotus
#

This got fixed in 2.7.2

#

Its actually single data - your saved data but displayed in multiple lines

high creek
zenith lotus
#

2.7.2 is under review.

#

Btw, were you able to reproduce the crash?

high creek
#

No, we are temporarily removing the auto cloud sync and giving the players a button to manually sync it. That should defintely bring down the crash rate

high creek
#

@zenith lotus I just wanted to update you that the crashes have decreased to normal levels after we increased the interval before another Synchronize() call can be made to 300 seconds. Initially, the interval was 1 second, which worked well with the older version 2.4.1. We then increased it to 60 seconds, which didn't have much effect, but after extending it to 300 seconds, crashes have significantly reduced. While they still occur (around 22% of crashes), we are now well below the bad behavior threshold.

zenith lotus
plain whale
high creek
# plain whale <@698393895553466411> I have the same problem but it only occurs after I call Ap...

Yes, we are using Application.Quit() for the Android back button in ExoMiner, but from the stack trace you shared, how can you tell that it’s happening during the Quit event?

Just to clarify, we’re still experiencing crashes, but they have decreased significantly after we imposed a 300 second limit before another Synchronize() call can be made. This restriction is in addition to setting the Sync Interval to 100000 in the Voxel Buster Cloud Services settings suggested by @zenith lotus