Android crash - no non-static method CustomUnityPlayer;.hidePreservedContent() #926
Labels
android
This issue is specific to the Android Platform.
bug
This issue refers to a bug in the plugin
Unity issue/bug
Problem caused by Unity that we can't fix on our end.
Description
This bug was first described in a larger issue #903, I'm just splitting it into a separate issue specific to this error.
On some Unity versions, android devices on Android 8 or lower will immediately crash when Unity is started.
(See more logs at the bottom)
Breaking change
I tested multiple Unity versions to find the exact version that breaks this.
The crash starts at Unity 2021.3.31 and 2022.3.10.
Both these versions have this entry in the changelog, that seems like the culprit.
Reproduction
Possible workaround
As noted in the original issue #903:
Adding the missing function signature to
CustomUntityPlayer.kt
in the plugin prevents the crash.However this causes the last paused frame to show when closing and reopening a page with the unitywidget.
Trying to call something like
super.hidePreservedContent
results inSo we might be able to call this private function using reflection.
Versions
❌ indicates a crash.
Unity:
2021.3.21 ✔
2021.3.28 ✔
2021.3.30 ✔
2021.3.31 ❌
2021.3.34 ❌
2021.3.35 ❌
2021.3.36 ❌
2022.3.0 ✔
2022.3.9 ✔
2022.3.10 ❌
2022.3.14 ❌
2022.3.15 ❌
2022.3.18 ❌
2022.3.19 ✔
2022.3.20 ✔
Android:
Android 6 ❌
Android 7.1.2 ❌
Android 8 ❌ (reported)
Android 9 ✔
Android 13 ✔
Devices:
This seems to happen on any device on Android <= 8.
Logs
Log Unity 2021.3.31, Android 6
Log Unity 2022.3.10, Android 7
The text was updated successfully, but these errors were encountered: