{"id":684,"date":"2010-07-07T00:19:38","date_gmt":"2010-07-07T04:19:38","guid":{"rendered":"https:\/\/lowtek.ca\/roo\/?p=684"},"modified":"2010-12-02T00:27:00","modified_gmt":"2010-12-02T04:27:00","slug":"when-android-fails","status":"publish","type":"post","link":"https:\/\/lowtek.ca\/roo\/2010\/when-android-fails\/","title":{"rendered":"When Android Fails"},"content":{"rendered":"<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2010\/07\/android.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-685\" title=\"android\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2010\/07\/android.jpg\" alt=\"\" width=\"500\" height=\"407\" \/><\/a><\/p>\n<p>I really have myself to blame. \u00a0Android is the right smart phone platform for me: provided you have a rooted phone, you can get inside the device and tinker and there are community created ROMs which let you change the base system. \u00a0It is effectively an embedded Linux platform with a java like application stack. \u00a0I tend to follow the <a href=\"http:\/\/www.cyanogenmod.com\/\">CyanogenMod<\/a> crowd.<\/p>\n<p>On my <a href=\"http:\/\/developer.htc.com\/adp.html\">ADP1<\/a>, I&#8217;ve got the developer friendly &#8220;fastboot&#8221;. \u00a0Using this you can install what is called a &#8220;recovery image&#8221; &#8211; a secondary boot mode which lets you get in and do maintenance etc. \u00a0Recently I found myself in a state where I had lost my recovery image. \u00a0The <a href=\"http:\/\/forum.cyanogenmod.com\/topic\/961-recoveryfixed-unable-to-reboot-to-recovery\/\">forum has some good basic advice<\/a> if this happens to you.<\/p>\n<p>As I found myself needing to reinstall. \u00a0The recommended recovery image is <a href=\"http:\/\/forum.xda-developers.com\/showpost.php?p=4647751\">Amon_RA<\/a>. \u00a0I used the fastboot flash method, from my Ubuntu desktop using the <a href=\"http:\/\/android-dls.com\/wiki\/index.php?title=Fastboot\">fastboot binary<\/a>. \u00a0Once I had the binary, it really was as easy as booting into fastboot mode (hold camera button while phone is booting) and runnning the fastboot program.<\/p>\n<p><code>fastboot flash recovery recovery_of_choice.img<\/code><\/p>\n<p>Now what got me to this state of no recovery image, was most likely a finger fumble while I was trying to recover the phone from a bad state. \u00a0(Did I mention I was to blame here?) \u00a0Now I suspect there is some sort of latent bug in the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Dalvik_(software)\">Dalvik<\/a> cache management that leads to this bad state, but I don&#8217;t yet have enough data to make a strong statement here.<\/p>\n<p>What happens is at one point, apps stop opening properly for me. \u00a0Specifically things like the web browser. \u00a0The <a href=\"http:\/\/forum.cyanogenmod.com\/topic\/1537-g1-with-508-boot-loop-fix\/\">1st time this happened<\/a>, I ended up wiping the phone and starting again from scratch. While this is a recommended step if you&#8217;re going to play in the ROM scene, it is annoying to lose all of your state. \u00a0To my dismay it happened again.<\/p>\n<p>The symptom is a boot loop when you reboot. \u00a0Using some of the tools from the <a href=\"http:\/\/developer.android.com\/sdk\/index.html\">Android SDK<\/a>, you can watch things as they happen on boot. \u00a0I use ddms for this. \u00a0In the most recent failure, the loop looked like this in the log:<\/p>\n<p><code>07-04 16:17:28.114: DEBUG\/AndroidRuntime(249): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<br \/>\n07-04 16:17:28.114: DEBUG\/AndroidRuntime(249): CheckJNI is OFF<br \/>\n07-04 16:17:28.284: DEBUG\/AndroidRuntime(249): --- registering native functions ---<br \/>\n07-04 16:17:28.544: ERROR\/AndroidRuntime(249): JavaVM unable to find main() in 'com.android.internal.os.ZygoteInit'<br \/>\n07-04 16:17:28.544: DEBUG\/AndroidRuntime(249): Shutting down VM<br \/>\n07-04 16:17:28.544: WARN\/dalvikvm(249): threadid=3: thread exiting with uncaught exception (group=0x4001e178)<br \/>\n07-04 16:17:28.574: DEBUG\/dalvikvm(249): DestroyJavaVM waiting for non-daemon threads to exit<br \/>\n07-04 16:17:28.574: DEBUG\/dalvikvm(249): DestroyJavaVM shutting VM down<br \/>\n07-04 16:17:28.574: DEBUG\/dalvikvm(249): VM cleaning u<\/code>p<\/p>\n<p>Not good. \u00a0Something can&#8217;t be found that is fairly critical, so the Dalvik system is continually bailing out on its start-up, then trying again.<\/p>\n<p>The fix was quite easy (if we ignore the step where during the investigation, I mess up my recovery image). \u00a0The adb tool found in the Android SDK is much more powerful than I initially understood it to be. \u00a0We can use it to stop the Android sytem.<\/p>\n<p><code>&gt; adb shell stop<\/code><\/p>\n<p>This effectively stops the boot loop from spinning around and around. \u00a0Now issuing:<\/p>\n<p><code>&gt; adb shell <\/code><\/p>\n<p>Gets you into the device, and we can go and fix the filesystem. \u00a0I located and cleared the Dalvik caches (deleted the contents of the directories).<br \/>\n<code>cache\/dalvik-cache<br \/>\nsd-ext\/dalvik-cache<br \/>\ndata\/dalvik-cache<\/code><\/p>\n<p>You may only need to clear the 3rd one, but that is the list I cleared out to get back into a working state. \u00a0Much easier than a full wipe and reconfigure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I really have myself to blame. \u00a0Android is the right smart phone platform for me: provided you have a rooted phone, you can get inside the device and tinker and there are community created ROMs which let you change the base system. \u00a0It is effectively an embedded Linux platform with a java like application stack. &hellip; <a href=\"https:\/\/lowtek.ca\/roo\/2010\/when-android-fails\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;When Android Fails&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,11],"tags":[],"class_list":["post-684","post","type-post","status-publish","format-standard","hentry","category-android","category-gadgets"],"_links":{"self":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":5,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":724,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/684\/revisions\/724"}],"wp:attachment":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}