Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException' #165

Open
FA72 opened this issue Nov 15, 2024 · 4 comments
Open

Comments

@FA72
Copy link

FA72 commented Nov 15, 2024

Describe the bug

Hello!
I tried to start my app on iOS, but get this exception

2024-11-15 13:48:33.806 MyApp.IOS[3349:1619377] Received unhandled Objective-C exception that was marshalled from a managed exception: Could not find the type 'ObjCRuntime.Registrar' in the assembly 'BranchSDK.iOSBinding'. (ObjCRuntime.RuntimeException)
at ObjCRuntime.RegistrarHelper.GetMapEntry(String assemblyName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 105
at ObjCRuntime.RegistrarHelper.GetMapEntry(Assembly assembly) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 93
at ObjCRuntime.RegistrarHelper.LookupRegisteredType(Assembly assembly, UInt32 id) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 199
at ObjCRuntime.Class.ResolveToken(Assembly assembly, Module module, UInt32 token) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 521
at ObjCRuntime.Class.ResolveFullTokenReference(UInt32 token_reference) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 449
at ObjCRuntime.Class.ResolveTokenReference(UInt32 token_reference, UInt32 implicit_token_type) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 486
at ObjCRuntime.Class.ResolveTypeTokenReference(UInt32 token_reference) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 454
at ObjCRuntime.Class.FindType(NativeHandle class, Boolean& is_custom_type) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 423
at ObjCRuntime.Class.Lookup(IntPtr klass, Boolean throw_on_error) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 222
at ObjCRuntime.Class.Lookup(IntPtr klass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 213
at ObjCRuntime.Runtime.GetNSObject[Branch](IntPtr ptr, IntPtr sel, RuntimeMethodHandle method_handle, Boolean evenInFinalizerQueue) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 1882
at ObjCRuntime.Runtime.GetNSObject[Branch](IntPtr ptr, IntPtr sel, RuntimeMethodHandle method_handle) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 1860
at ObjCRuntime.Runtime.GetNSObject[Branch](IntPtr ptr) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 1855
at IOSNativeBranch.Branch.GetInstance(String branchKey)
at BranchSDK.BranchIOS.get_NativeBranch()
at BranchSDK.BranchIOS.Init(String branchKey, NSDictionary launchOptions, IBranchBUOSessionInterface callback)
at CardsIOS.AppDelegate.InitConfigurations(NSDictionary launchOptions) in /Users/pavelderevyankin/RiderProjects/MyApp.MobileApp/Cards.IOS/AppDelegate.cs:line 257
at CardsIOS.AppDelegate.WillFinishLaunching(UIApplication application, NSDictionary launchOptions) in /Users/pavelderevyankin/RiderProjects/MyApp.MobileApp/Cards.IOS/AppDelegate.cs:line 97
at CardsIOS.AppDelegate.Registrar_Callbacks.callback_9_CardsIOS_AppDelegate_WillFinishLaunching(IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr p1, IntPtr* exception_gchandle)

Steps to reproduce

  1. Build Project with branch-xamarin-linking-sdk/9.0.1
  2. Start on real device
  3. Get Error

Expected behavior

Just worked app =)

SDK Version

9.0.0

Make and Model

iPhone 11 Pro

OS

iOS 17.4.1

Additional Information/Context

No response

@robin-schroeder-merc
Copy link

What is the status on this bug? We are experiencing the same.

@mattpearcefanhub
Copy link

Likewise with the newer version of xcode (16.2) and dotnet 9 I am experiencing the same issue.

@FA72
Copy link
Author

FA72 commented Dec 13, 2024

@robin-schroeder-merc @mattpearcefanhub
I have workaround https://blog.ostebaronen.dk/2024/11/dotnet9-gotchas.html
It's problem with .Net9. I think, no problem with branch. May be it's help you.

@mattpearcefanhub
Copy link

That sorted it for me, thanks @FA72 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants