The last message on the console is "Installing RelativeLayout.apk..." and it just stays there forever, instead of going on to the "Success" message. So the app isn't loading. Visually, what is happening on the emulator is that it starts with the "A N D R O I D" phase, goes on to the chrome "android" phase, goes on to the home page, and then the little animating battery icon stops moving. After that we go back to the chrome "android" and just stay there forever. Quitting the emulator and rerunning the app didn't help.
The Android Developers site has a Troubleshooting page. I was very interested to find out about the adb tool (Android Debug Bridge tool). In a Terminal window I fiddled with it a bit. I followed the suggestion of quitting Eclipse, killing the server (which is apparently the process that runs the Android Virtual Device on the emulator), and rerunning the app, but that was no help. I ran adb with the logcat option and watched all the log output while trying to run the app, but there was way too much stuff and it went by too fast. So I redirected it to a file:
./adb logcat > log.txtand ran the app again. Looking at the file in TextEdit, there are lots of error-appearing messages, but none of them are obviously my issue. I do see something curious though. At one point the log lists service after service that died. This occurs right after this log message:
D/Zygote ( 32): Process 59 terminated by signal (11)When I run adb logcat without redirecting the output and have the emulator window visible at the same time, I can see that the battery icon stops animating just about when this message appears. Very interesting, but I have no idea what to do with this information.
I ended up spending a couple days stuck on this issue. I tried rebooting my Mac. I fiddled with the adb tool some more. I found the DDMS perspective in Eclipse which has many cool-looking things, including being able to explore the files on the AVD, but I couldn't find anything helpful there. I noticed that much of its functionality shows up as tabs on the console pane in the Java perspective. I figured there must be a forum somewhere which might be helpful, and I found links on the Android Developer site. However, the link to the beginner's forum told me that they were just shutting it down and to go to Stack Overflow instead. I signed up there and searched through the Android stuff, but didn't find anything that addressed my issue.
Eventually I decided to try starting the first tutorial over from scratch. If that didn't accomplish anything, I was going to try reinstalling the Android SDK and Eclipse. Fortunately, I didn't have to go that far. In the first tutorial we create an AVD and in the redoing I made a new AVD. The tutorial ran and the other tutorials also ran, somehow using the new AVD. I kept fiddling and the tutorials all stopped running again, even using the new AVD. I kept poking around in Eclipse and ended up at Window --> Android SDK and AVD Manager which has a list of the AVD's if you click on "Virtual Devices" on the left. What I discovered to work is to quit the emulator, then in this window to select the AVD I'm trying to use, click "Start..." on the right, then in the Launch Options box that comes up, check Wipe user data, then hit Launch. The emulator will run until the home page shows up, then I can run my tutorial just fine. I don't really have a clue as to what is going wrong or how this fixes it, but at least this way I have a method of getting a dead AVD to start working again.
This was a massively frustrating exercise.
No comments:
Post a Comment