Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2019.4.X, 2020.3.X, 2021.1.X
Votes
3
Found in
2018.4
2019.4
2019.4.23f1
2020.3
2021.1
2021.2
Issue ID
1335306
Regression
No
[Android][IL2CPP] App Crashes when using MonoPInvokeCallback attribute in a project with an IL2CPP Scripting Backend
How to reproduce it:
1. Open the attached project "EmptyProject.zip"
2. Build and Run it on Android
3. Observe the app that runs on Android
Expected result: App doesn't crash
Actual result: App crashes
Reproducible with: 2018.4.35f1, 2019.4.28f1, 2020.3.10f1, 2021.1.10f1, 2021.2.0a19
Reproducible devices:
VLNQA00122, Samsung Galaxy S9 (SM-G960F), Android 10, CPU: NOT FOUND, GPU: Mali-G72
VLNQA00331, Huawei P20 lite (ANE-LX1), Android 9, CPU: HiSilicon Kirin 659, GPU: Mali-T830
VLNQA00321, Xiaomi MI 9 (MI 9), Android 10, CPU: Snapdragon 855 SM8150, GPU: Adreno (TM) 640
VLNQA00038, Htc Desire 510 (HTC Desire 510), Android 4.4.3, CPU: Snapdragon 410 MSM8916, GPU: Adreno (TM) 306
VLNQA00285, Samsung Galaxy J4 Core (SM-J410F), Android 8.1.0, CPU: Snapdragon 425 MSM8917, GPU: Adreno (TM) 308
Notes:
- Doesn't reproduce with Mono Scripting Backend
- Not reproducible after building and running on macOS
- Not reproducible when "[MonoPInvokeCallback(typeof(MainDelegateFunction))]" is commented in the "DebugMarshalPointers.cs" file
Code that causes the crash:
[Preserve]
[MonoPInvokeCallback(typeof(MainDelegateFunction))]
public static void OnRequestComplete(int status)
{
Debug.LogError("OnRequestComplete " + status);
}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Editor becomes unresponsive and memory allocation errors are spammed in the Console when Generating Lightning
- Crash on BatchApplyPropertiesFromSourceAssetDB when opening a specific project
- Scene view Camera cannot be moved with WASD/QE keys when the Right Mouse Button is held down and the Mouse is not moved
- Crash when calling default interface method from virtual method with same name
- [Android] Unity does not include the ".aab" extension for an AppBundle when it is built via script with the buildPlayerOptions.locationPathName = "AppName.apk" and EditorUserBuildSettings.buildAppBundle = true
Resolution Note (fix version 2021.2):
Fixed in 2022.1.0a3
Resolution Note (fix version 2021.2):
Fixed in: 2021.2.0b7
Resolution Note (fix version 2021.1):
Fixed in 2021.1.15f1
Resolution Note (fix version 2020.3):
Fixed in: 2020.3.17f1