Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mono for Android App crashes on start after clears data in app settings

I have found that my Mono for Android app crashes on each start after the user goes to Settings->Apps->MyApp and selects "Clear Data". I created a new project with the Mono for Android "Hello World" application, and this app exhibits exactly the same behaviour, which leeds me to the assumption this happens somewhere in the mono stack away from my control. If I check with adb logcat, this are the relevant lines that I can find:

I/ActivityManager(  185): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Test_App.Test_App/test_app.Activity1} from pid 386
D/dalvikvm(18358): Late-enabling CheckJNI
I/dalvikvm(18358): Turning on JNI app bug workarounds for target SDK version 8...
I/ActivityManager(  185): Start proc Test_App.Test_App for activity Test_App.Test_App/test_app.Activity1: pid=18358 uid=10074 gids={3003}
D/dalvikvm(  119): GC_EXPLICIT freed 37K, 3% free 12553K/12867K, paused 1ms+2ms
I/ActivityThread(18358): Pub Test_App.Test_App.mono.MonoRuntimeProvider.__mono_init__: mono.MonoRuntimeProvider
D/dalvikvm(18358): Trying to load lib /data/data/Test_App.Test_App/lib/libmonodroid.so 0x4168ba48
D/dalvikvm(18358): Added shared lib /data/data/Test_App.Test_App/lib/libmonodroid.so 0x4168ba48
D/dalvikvm(  119): GC_EXPLICIT freed <1K, 3% free 12553K/12867K, paused 2ms+2ms
E/mono    (18358): WARNING: The runtime version supported by this application is unavailable.
E/mono    (18358): Using default runtime: v2.0.50727
D/OpenGLRenderer(  386): Flushing caches (mode 1)
D/dalvikvm(  119): GC_EXPLICIT freed <1K, 3% free 12553K/12867K, paused 1ms+1ms
I/mono    (18358): Stacktrace:
I/mono    (18358): 
D/OpenGLRenderer(  386): Flushing caches (mode 0)
D/Zygote  (  119): Process 18358 terminated by signal (11)
I/ActivityManager(  185): Process Test_App.Test_App (pid 18358) has died.
W/ActivityManager(  185): Force removing ActivityRecord{41a85018 Test_App.Test_App/test_app.Activity1}: app died, no saved state

Does anyone have the same behaviour in his mono apps? Is there a fix?

like image 699
huesforalice Avatar asked Oct 24 '12 10:10

huesforalice


1 Answers

Managed to solve my own question. Under project settings I had to go to "Mono for Android Build" tab, select the Release configuration and make the linker "Link all assemblies" instead of "Link SDK assemblies only". Fixed this by trial and error, but what can you do..

like image 85
huesforalice Avatar answered Jan 01 '23 19:01

huesforalice