1
votes

When I try running the default "Mono for Android Application", I get an error that the application has stopped unexpectedly.

enter image description here

After, (sometimes) I would get an exception in MonoDevelop: System.IO.IOException: DWP Handshake failed.

I'm not sure what could be wrong - I haven't made any changes to the application. Any help would be greatly appreciated - I've been trying to get this running all day.

TIA

Stacktrace:

D/AndroidRuntime( 2066): Shutting down VM E/AndroidRuntime( 2066): FATAL EXCEPTION: main E/AndroidRuntime( 2066): java.lang.UnsatisfiedLinkError: Couldn't load monodroid: findLibrary returned null E/AndroidRuntime( 2066): at java.lang.Runtime.loadLibrary(Runtime.java:429) E/AndroidRuntime( 2066): at java.lang.System.loadLibrary(System.java:554) E/AndroidRuntime( 2066): at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:24) E/AndroidRuntime( 2066): at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:25) E/AndroidRuntime( 2066): at android.app.ActivityThread.installProvider(ActivityThread.java:3554) E/AndroidRuntime( 2066): at android.app.ActivityThread.installContentProviders(ActivityThread.java:3309) E/AndroidRuntime( 2066): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3265) E/AndroidRuntime( 2066): at android.app.ActivityThread.access$2200(ActivityThread.java:117) E/AndroidRuntime( 2066): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969) E/AndroidRuntime( 2066): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 2066): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 2066): at android.app.ActivityThread.main(ActivityThread.java:3683) E/AndroidRuntime( 2066): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2066): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime( 2066): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/AndroidRuntime( 2066): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/AndroidRuntime( 2066): at dalvik.system.NativeStart.main(Native Method) I/Process ( 2066): Sending signal. PID: 2066 SIG: 9

2
You should be able to find the stacktrace from the crash in the debug logs, please add that to the question docs.xamarin.com/android/advanced_topics/android_debug_logGreg Shackles

2 Answers

2
votes

I had a similar problem not long after going with the paid version. Simply clean and rebuild to update the references to the new monodroid library.

See also: http://www.mail-archive.com/[email protected]/msg00531.html

0
votes

This is very probably Android bug 21670: sometimes native libraries are not extracted from the .apk, but the installation is still reported as successful:

W/NativeHelper(   98): Failed to cache package shared libs
W/NativeHelper(   98): java.io.IOException: Couldn't create cached binary /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so in /data/data/Mono.Android.DebugRuntime/lib
W/NativeHelper(   98):  at com.android.internal.content.NativeLibraryHelper.copyNativeBinaryLI(NativeLibraryHelper.java:289)

Check your Android Debug Logs for a message similar to the above to confirm that this is the case.

If you see the above, you need to uninstall your app and as many other packages as possible to free up storage space, then reinstall your app.