Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Firebase.Crashlytics.StackFrame.Create(nuint address) has wrong method selector #652

Open
aliyailina opened this issue Mar 20, 2024 · 0 comments

Comments

@aliyailina
Copy link

aliyailina commented Mar 20, 2024

Calling Firebase.Crashlytics.StackFrame.Create(nuint address) causes unrecognized selector exception.

[Export] attribute has wrong selector parameter stackFrameWithAddress:address, while it must be stackFrameWithAddress:.

Workaround

You can invoke method directly as described in documentation.

Declare this method somewhere (usually, in class where you use it):

[DllImport("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
internal static extern IntPtr IntPtr_objc_msgSend_UIntPtr(IntPtr receiver, IntPtr selector, UIntPtr arg1);

Then use it like this:

using ObjCRuntime;
using Firebase.Crashlytics;

...


var stackFramePointer = IntPtr_objc_msgSend_UIntPtr(new Class(typeof(StackFrame)).Handle, Selector.GetHandle("stackFrameWithAddress:"), (UIntPtr)address);
var stackFrame = Runtime.GetNSObject<StackFrame>(stackFramePointer);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant