Open tombly opened 6 years ago
I can confirm this works in the simulator and fails on device. Looking into the details now.
Hi @chamons , Any updates on this issue? I ran into it when updating our mtouch and embeddinator:
System.TypeInitializationException: The type initializer for 'SomeLibraryClass' threw an exception. ---> System.EntryPointNotFoundException: xamarin_IntPtr_objc_msgSend_IntPtr at (wrapper managed-to-native) ObjCRuntime.Messaging.xamarin_IntPtr_objc_msgSend_IntPtr(intptr,intptr,intptr) at Foundation.NSObject.ValueForKey (Foundation.NSString key) [0x0001c] in /Xamarin/xamarin-macios/src/build/ios/native/Foundation/NSObject.g.cs:598
Was able to change the code from "ValueForKey" to "ObjectForKey" which seems to work in our case. The "ValueForKey" was most likely a result of previous version of tools generating this error at runtime: Received unhandled ObjectiveC exception: NSInvalidArgumentException *** -[NSDictionary objectForKey:]: method only defined for abstract class. Define -[__NSCFDictionary objectForKey:]!
Maybe you can point me in the right direction to investigate this?
xamarin_IntPtr_objc_msgSend_IntPtr
is supposed to be in libxamarin.a
, which is supposed to be linked into the resulting framework.
Can you attach a complete and verbose build log?
Hello!
If I add the following code to a library:
I get an exception:
Is this a bug or expected behavior or user error?
Additional details: I'm using the Embeddinator 0.4 (built from GitHub) to convert a Xamarin.iOS Class Library (built using VS Mac) and using the resulting native library in a typical native iOS app compiled with Xcode. I've successfully embedded the .NET library into the native iOS app, made calls to the library, etc., so everything seems to be working fine, I just run into a problem when I add the two lines above.
The Embeddinator is really awesome, well done.
Thanks! -Tom B.