kenneththorman / webrtc-app-mono

Porting WebRTC app to C# - Mono.Android (and iOS in the future - hoping for code reuse using MVVMCross)
BSD 3-Clause "New" or "Revised" License
28 stars 13 forks source link

Native lib interop issue when launching #1

Closed kenneththorman closed 10 years ago

kenneththorman commented 10 years ago

12-21 19:29:04.298 I/MonoDroid(15226): UNHANDLED EXCEPTION: System.Runtime.InteropServices.MarshalDirectiveException: Type Java.Lang.Object which is passed to unmanaged code must have a StructLayout attribute. 12-21 19:29:04.298 I/MonoDroid(15226): at (wrapper managed-to-native) WebRtc.ViEAndroidJavaAPI.Java_org_webrtc_videoengineapp_ViEAndroidJavaAPI_NativeInit (Android.Content.Context) <IL 0x00030, 0x00108> 12-21 19:29:04.298 I/MonoDroid(15226): at WebRtc.ViEAndroidJavaAPI..ctor (Android.Content.Context) [0x00033] in c:\Users\kenneth.thorman\Documents\GitHub\webrtc-app-mono-mvvmcross\WebRtc.Mono.Droid\ViEAndroidJavaAPI.cs:30 12-21 19:29:04.298 I/MonoDroid(15226): at WebRtc.Mono.Droid.WebRTCDemo.startMain () [0x0004b] in c:\Users\kenneth.thorman\Documents\GitHub\webrtc-app-mono-mvvmcross\WebRtc.Mono.Droid\WebRTCDemo.cs:533 12-21 19:29:04.298 I/MonoDroid(15226): at WebRtc.Mono.Droid.WebRTCDemo.OnCreate (Android.OS.Bundle) [0x0028e] in c:\Users\kenneth.thorman\Documents\GitHub\webrtc-app-mono-mvvmcross\WebRtc.Mono.Droid\WebRTCDemo.cs:313 12-21 19:29:04.298 I/MonoDroid(15226): at Android.App.Activity.n_OnCreate_Landroid_osBundle (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/d23a19bf/source/monodroid/src/Mono.Android/platforms/android-17/src/generated/Android.App.Activity.cs:2119 12-21 19:29:04.298 I/MonoDroid(15226): at (wrapper dynamic-method) object.705dc6ba-9c58-4bcd-a8a2-f12584a9175f (intptr,intptr,intptr) <IL 0x00017, 0x00043>

This has been posted as a posting on Xamarin forum

http://forums.xamarin.com/discussion/11589/porting-google-webrtc-app-to-c-android-and-ios-in-the-future-mvvmcross-native-lib-problem

If anyone can share information on how to solve this please feel free

kenneththorman commented 10 years ago

Fixed, not relevant with using the new approach using a Java bindings library