bugsnag-unity
bugsnag-unity copied to clipboard
Unity 2022.1.14f1 IL2CPP android compilation leads to a ArgumentException: Object must be an array of primitives on Bugnag.Start()
Hello!
We had an issue on our project with the new version of Unity, it would seems the the "BlockCopy", when converted by IL2CPP doesn't support the parameter bugsnag sends it.
an empty 2022.1.14f1 project with the following script :
using BugsnagUnity;
using UnityEngine;
public class Test : MonoBehaviour
{
void Start()
{
var config = BugsnagSettingsObject.LoadConfiguration();
Bugsnag.Start(config);
}
}
This will lead, once built with IL2CPP and run on an android device to the following exception, making the game unrunnable
2022-08-25 14:57:07.550 13677-10271/? E/Unity: ArgumentException: Object must be an array of primitives. at System.Buffer.ByteLength (System.Array array) [0x00000] in <00000000000000000000000000000000>:0 at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.NativeInterface.BuildJavaStringDisposable (System.String input) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.NativeInterface.ConvertStringArgsToNative (System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.NativeInterface.CallNativeVoidMethod (System.String methodName, System.String methodSig, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.NativeClient.AddNativeMetadata (System.String section, System.Collections.Generic.IDictionary`2[TKey,TValue] data) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.AutomaticDataCollector.SetDef
I have attached the sample project for which we were able to reproduce the issue on : CustomBugsnagTest.zip
We were trying to find a solution to this, but in the meantime I am opening a ticket here, maybe someone has a solution for this? Thank you very much! Regards,
Hi 👋 Thanks for letting us know about this! We are looking into this right now and will let you know what we find asap 👍
I am running into the same issue now, when things used to work fine. I recently updated from Unity 2020.3.32f1 to Unity 2020.3.38f1, not sure if that's related or not.
Thanks for the update. We already have a fix that's being tested and should be released in the near future 👍
Hi @JinFox & @emrys90 - just to let you know a fix for this was released in v7.1.1
of bugsnag-unity
. Thanks again for reporting!
Thank you for your awesome reactiveness!