Crash with "sendEventsInArray" in Unreal 4.27 on Android / Quest device
S
Sam Polglase
Our users are getting crashes on Meta Quest 2 / Quest 3 devices when using GameAnalytics in Unreal engine.
I haven't yet been able to reproduce the issue locally, but we've had 13 users affected and 107 crashes since we released a couple months ago.
I'm pulling these crashes from the Oculus / Meta crashes dashboard, so I'm not 100% sure if these crashes are taking down the game process / game threads.
So three questions:
- Any idea what's going on with this crash?
- Does this type of crash take down the game completely when it's running on a Quest / Android device?
- How should we go about fixing this issue?
Version of Unreal: 4.27.2 (Oculus-VR custom engine version 57)
Version of GameAnalytics plugin: 5.1.14
The stack trace looks like this:
java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.art/javalib/core-oj.jar)
at com.gameanalytics.sdk.utilities.TaskRunner.executeAsync(Unknown Source:2)
at com.gameanalytics.sdk.http.GAHTTPApi.sendSdkErrorEvent(Unknown Source:235)
at com.gameanalytics.sdk.http.GAHTTPApi.sendSdkErrorEvent(Unknown Source:9)
at com.gameanalytics.sdk.http.GAHTTPApi.sendEventsInArray(Unknown Source:303)
at com.gameanalytics.sdk.events.GAEvents.processEvents(Unknown Source:385)
at com.gameanalytics.sdk.events.GAEvents.processEventQueue(Unknown Source:3)
at com.gameanalytics.sdk.events.GAEvents.access$000(Unknown Source:0)
at com.gameanalytics.sdk.events.GAEvents$1.execute(Unknown Source:0)
at com.gameanalytics.sdk.threading.GAThreading$1.run(Unknown Source:8)
at java.util.TimerThread.mainLoop(Timer.java:562)
It looks to me like there's an event request response happening in GAHTPApi::sendEventsInArray() but the json dictionary is null and then it tries to send an sdk error event but sending that sdk error event causes a crash when it tries to use java.lang.invoke.LambdaMetafactory.
Nicky Toma
Hi Sam! I've discussed this with our SDK team, and they suggested to find the GameAnalytics_APL.xml file that can be found in the GameAnalytics plugin directory.
There should be a line there e.g.: implementation('com.gameanalytics.sdk:gameanalytics-android:6.6.2'). The android version here is only an example.
Our SDK team suggested to update the Android version in this line, the latest version works in this case, and hopefully that will fix the crashes.
Let me know if you have more questions!
S
Sam Polglase
Nicky Toma Thanks Nicky.
Right now it looks like this:
implementation('com.gameanalytics.sdk:gameanalytics-android:6.2.9')
Do you have a recommendation on what I should change it to?
Is your recommendation this:
implementation('com.gameanalytics.sdk:gameanalytics-android:6.6.2')
That would match with the new version of the plugin that supports Unreal 5. Does it make more sense to just upgrade the plugin to the newest version? It looks like the newest version is 5.4.5 on GitHub. Will that still be compatible with Unreal 4? Our version (5.1.14) was released back in March 2022.
Nicky Toma
Sam Polglase: Hi Sam. Our SDK team suggested that using the latest android SDK version shouldn't cause any issues. That would be 6.6.2. Just in case do run some tests before releasing it to live.
Regarding updating the SDK, that would be a no, as due to how UE changed from 4 to 5 the newer SDKs are not compatible with UE4.
Let me know if it gets rid of the crashes!
S
Sam Polglase
Nicky Toma Thanks! One other question, do you think a crash like this in the GameAnalytics thread would take down the game fully or will this type of crash go unnoticed for players?
I haven't reproduced this crash locally and I only discovered it via the Meta crash reporting tools.
Nicky Toma
Sam Polglase: I can ask our SDK team tomorrow.
Also apologies for the confusion, I only realized that the line of code I sent had the latest android SDK version, so that's what you had to change it to. Sorry for the confusion there!