tag:blogger.com,1999:blog-8001170587821659759.post142801981869691637..comments2023-08-22T02:10:46.226-07:00Comments on My Brain Hurts: Building Mono for AndroidKoushhttp://www.blogger.com/profile/11049460148325973407noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-8001170587821659759.post-17100781868288849992009-04-01T08:23:00.000-07:002009-04-01T08:23:00.000-07:00As a final note to my previous post, my .Net app r...As a final note to my previous post, my .Net app runs as expected on Linux Ubunty Hardy but was developed in #D on Windows.<BR/><BR/>I have not tried with an app developed in MonoDevelop on Linux.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-77003837347129189352009-04-01T08:22:00.000-07:002009-04-01T08:22:00.000-07:00This comment has been removed by the author.nullhttps://www.blogger.com/profile/03666624578355631508noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-14371625719299447182009-03-31T21:05:00.000-07:002009-03-31T21:05:00.000-07:00I followed your instructions trying to run in the ...I followed your instructions trying to run in the Android emulator a .Net 2.0 Winforms application (graphics, audio) created in SharpDevelop on Vista. First I tried using Mono.apk; my app crashed, the error raised was something like "Winforms assembly not found". Then I mounted your sdncard.img image file (the one with debian and mono prebuilt), launched the Android emulator with the mofified ext2 kernel image, then tried to run /sdcard/kit/bash.sh. As you know, files on the sdcard cannot be either run or set as executables. So I opend bash,sh on my Linux box and then executed the commands within in the Android shell. Finally, I copied my .net executable and files from my Linux box to the /home folder in the debian mounted system. Upon issuing mono myapp.net it crashed with an error message pointing to a unimplemented property in Winforms.<BR/><BR/>Bottom line, mono for debian-arm is not yet up to the job. <BR/><BR/>Congratulations on making it possible to get this far!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-15402527406252992009-01-13T09:39:00.000-08:002009-01-13T09:39:00.000-08:00Hi there,Is it likely that consumers could benefit...Hi there,<BR/><BR/>Is it likely that consumers could benefit of these developments ? I mean could I develop applications for the Android platform that users could run on a G1 for example without having to do anything else then installing my app ?Unknownhttps://www.blogger.com/profile/18253207115575802785noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-28120979165720116492009-01-10T17:18:00.000-08:002009-01-10T17:18:00.000-08:00Hi Richard, I've fixed the assertions/exceptions. ...Hi Richard, I've fixed the assertions/exceptions. See http://www.koushikdutta.com/2009/01/mono-for-android-first-update.html for more information as well as an updated APK.Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-68101591481540381062009-01-08T21:25:00.000-08:002009-01-08T21:25:00.000-08:00Sure, give me a moment. I've successfully gotten m...Sure, give me a moment. I've successfully gotten mono compiling and working with eglib. That decreases the footprint of Mono considerably. <BR/><BR/>I'm working on linking it with bionic now (Android's libc). After that is done, it should run on Android's flavor of Linux flawlessly.Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-37548543739604120452009-01-08T21:22:00.000-08:002009-01-08T21:22:00.000-08:00I tried recompiling but I still get the error. Thi...I tried recompiling but I still get the error. Think you could upload your working /usr/local/bin/mono to rapidshare for me?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-43000645356204376812009-01-08T16:58:00.000-08:002009-01-08T16:58:00.000-08:00Hmm possibly, but I don't see why it would. Try us...Hmm possibly, but I don't see why it would. <BR/><BR/>Try using the vanilla /sdcard/kit/bash.sh that I provided and verify that it works.<BR/><BR/>Feel free to email me at koushikdutta at hotmail dawt cawmKoushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-55874424227917779152009-01-08T16:54:00.000-08:002009-01-08T16:54:00.000-08:00Yes, after running a chroot. I wonder if this prob...Yes, after running a chroot. I wonder if this problem is because I mounted it under /sdcard/kit/mnt instead of under /data. What do you think?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-6013513166894509202009-01-08T16:45:00.000-08:002009-01-08T16:45:00.000-08:00Richard, is that happening under Debian?Richard, is that happening under Debian?Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-46508424664269501672009-01-08T16:21:00.000-08:002009-01-08T16:21:00.000-08:00Using your sdcard.zip I get a:Unhandled Exception:...Using your sdcard.zip I get a:<BR/><BR/>Unhandled Exception: System.TypeInitializationException: An exception was<BR/>thrown by the type initializer for Mono.CSharp.Location ---><BR/>System.ExecutionEngineException: SIGILL<BR/> at System.Collections.Hashtable..ctor (Int32 capacity, Single loadFactor, IHashCodeProvider hcp, Icomparer) [0x00000] <BR/> at System.Collections.Hashtable..ctor (Int32 capacity, Single loadFactor) [0x00000] <BR/> at System.Collections.Hashtable..ctor () [0x00000] <BR/> at Mono.CSharp.Location..cctor () [0x00000] --- End of inner exception stack trace ---<BR/><BR/><BR/>whenever I run gmcs or gmcs hello.cs without an exe being created. Strangely, mono hello.exe prints out the "Hello World!" message and then the error above. Any ideas?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-29829647171388931852009-01-07T14:50:00.000-08:002009-01-07T14:50:00.000-08:00Hopefully I'll have a simple Mono APK available on...Hopefully I'll have a simple Mono APK available on the Market later this week!Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-32082555934048765802009-01-07T14:49:00.000-08:002009-01-07T14:49:00.000-08:00Total disk footprint of Mono and all it's dependen...Total disk footprint of Mono and all it's dependencies is 6598288. I'm trying a build with eglib now (and I'm also going to change the path of the linker and see if it works on Android out-of-box). Crossing my fingers...Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-67221224665084985372009-01-07T11:36:00.000-08:002009-01-07T11:36:00.000-08:00Rapidshare is a good upload site. I too can't acce...Rapidshare is a good upload site. I too can't access the sdcard.zip and this measly laptop would take hours for me to compile myself. Thanks for all your hard work.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-85462218037520710432009-01-07T11:24:00.000-08:002009-01-07T11:24:00.000-08:00To elaborate further on why "--dynamic-linker ld-l...To elaborate further on why "--dynamic-linker ld-linux.so.3" works (in case it isn't obvious).<BR/><BR/>Since it is not a full coded path, executables will look for that file in their (current) directory at runtime. <BR/><BR/>I should probably write this up in a separate post-- I know a lot of other Android developers are also trying to make the standard ARM/Linux build outputs work on Android.<BR/><BR/>The downside to this is that libc.so.6 is 5 times the size of /system/bin/libc.so. And we'd effectively be loading the same library twice into memory. The optimal solution is to recompile everything to reference Android's libc.so. Or, maybe customize ld-linux.so.3 to special case libc. But that might not work-- I'll take a wild stab and say that Android's libc may just be a subset of ARM/Linux libc due to the disparity in file sizes.Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-67908417884720013002009-01-07T11:15:00.000-08:002009-01-07T11:15:00.000-08:00I've tried the -static flag; it doesn't work; didn...I've tried the -static flag; it doesn't work; didn't look into it further though. It's a bit of a kludge. :)<BR/><BR/>The cause of the problem is that mono is looking for the linker at /lib/ld-linux.so.3, which does not exist on Android. Android's linker is /system/bin/linker. However, by using the --dynamic-linker option on ld, you can change where an executable looks for the linker.<BR/><BR/>So, basically by passing "--dynamic-linker ld-linux.so.3" to the linker during make, and make sure that the linker (and all of Mono's dependencies) are in the same directory as mono.<BR/><BR/>I've tested with a few simple programs to verify it works-- and it does.<BR/><BR/>Furthermore, this should work for *all* phones, not just jailbroken ones.<BR/><BR/>Here are the list of dependencies of Mono (each dependency may have further unlisted dependencies).<BR/><BR/>libgthread-2.0.so.0<BR/>libglib-2.0.so.0<BR/>librt.so.1<BR/>libdl.so.2<BR/>libpthread.so.0<BR/>libm.so.6<BR/>libgcc_s.so.1<BR/>libc.so.6<BR/>libpcre.so.3<BR/>/lib/ld-linux.so.3Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-90140582111128776032009-01-07T11:14:00.000-08:002009-01-07T11:14:00.000-08:00I can see that m(iguel?) is intensely interested i...I can see that m(iguel?) is intensely interested in getting Mono to run on Android. I can't blame him, as I too would love to see Mono run on ... everything!<BR/><BR/>I'll be watching this blog closely. I don't have a G1 to test with yet, the Agora Pro is on the top of my list though.jhttps://www.blogger.com/profile/16615735277873879655noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-21636398130120833552009-01-07T11:05:00.000-08:002009-01-07T11:05:00.000-08:00What are the dyanamic dependencies that you have?W...What are the dyanamic dependencies that you have?<BR/><BR/>Would you mind running: ldd mono?<BR/><BR/>You could try passing the "-static" flag to the GCC command line that produces the `mono' executable.mdihttps://www.blogger.com/profile/11428205606558379989noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-62047123504064888222009-01-06T19:52:00.000-08:002009-01-06T19:52:00.000-08:00I'll look into getting a mirror.I'll look into getting a mirror.Koushhttps://www.blogger.com/profile/11049460148325973407noreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-74180708601992187452009-01-06T19:50:00.000-08:002009-01-06T19:50:00.000-08:00Think you could upload your sdcard.zip file elsewh...Think you could upload your sdcard.zip file elsewhere? My download speed slows to a crawl after a couple minutes of downloading. Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8001170587821659759.post-25203097688699090672009-01-06T10:13:00.000-08:002009-01-06T10:13:00.000-08:00Thanks for posting the instructions!Thanks for posting the instructions!Anonymousnoreply@blogger.com