Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android Initial Set Up Won't Finish!

I am running the Windows 8 64-bit package and I have been having some issues running my "Crystal Ball" app. The running application is nullified, then canceled, according to the console box.

I have tried many different ideas to fix this but none of them worked. Then, as I was rewatching the video, I realized when I run the Initial Set Up, it doesn't actually finish like how it does in the video. What it does is pause and then tells me to press any key to continue, I do, and when I do, the Initial Set Up box closes on its own without finishing or doing anything afterwards. I'm thinking this is the reason why I can't run the Crystal Ball app.

Any ideas on how I can resolve this?

10 Answers

Check your AVD Manager. Do you have an Android virtual machine created there?

What is the output from your Console?

Also, what is the output from your LogCat? You can open the LogCat window by going to Window -> Show View -> Other. The select LogCat.

Yes I do have an Android virtual machine and it does have that green check mark next to it.

My Console is just telling me that it was nullified and canceled. I also looked at my LogCat but I have no idea what it is saying and even after it was nullified and canceled it still kept going.

Right now I am trying Google's Android development bundle. I had some issues with this earlier as well, something to do with java and how there was no virtual machine, but I believe I have gotten that straightened out. I'm running the Crystal Ball app as we speak. Although Google's Android development bundle moves much slower than the one from TeamTreeHouse. Probably will be 20-30 minutes before I see anything actually happen, besides the Android logo.

20-30 minutes sounds a little excessive. For reference, my computer is about five years old and it takes about 2-4 minutes for the emulator to come up and the application to run. Make sure that you have the "snapshot" option enabled for your emulator. To check that, open the AVD Manager, click Edit on your device, and make sure the Snapshot option is checked.

I pasted a standard output from Eclipse's Console window below, using a brand new emulator that I just created. You can see that it takes about two minutes for the emulator to come up and the application to run. If your Console window doesn't have similar messages, then something is probably wrong with your setup. If you paste the output from your Console and LogCat windows, I'll take a look.

[2014-01-13 18:11:19 - Crystal Ball] New emulator found: emulator-5554
[2014-01-13 18:11:19 - Crystal Ball] Waiting for HOME ('android.process.acore') to be launched...
[2014-01-13 18:12:30 - Crystal Ball] HOME is up on device 'emulator-5554'
[2014-01-13 18:12:30 - Crystal Ball] Uploading Crystal Ball.apk onto device 'emulator-5554'
[2014-01-13 18:12:36 - Crystal Ball] Installing Crystal Ball.apk...
[2014-01-13 18:13:25 - Crystal Ball] Success!
[2014-01-13 18:13:25 - Crystal Ball] Starting activity com.example.crystal.ball.MainActivity on device emulator-5554
[2014-01-13 18:13:29 - Crystal Ball] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.crystal.ball/.MainActivity }

Google was taking too long. So I switched back to the TeamTreeHouse development bundle. I also made sure the Snapshot was enabled, and it was, except when I went to Windows > Other > Devices, nothing showed. Tried it several more times, nothing showed. This is what I got from my Console:

[2014-01-13 18:07:28 - Crystal Ball] Android Launch! [2014-01-13 18:07:28 - Crystal Ball] adb is running normally. [2014-01-13 18:07:28 - Crystal Ball] Performing com.example.crystal.ball.MainActivity activity launch [2014-01-13 18:07:28 - Crystal Ball] Automatic Target Mode: launching new emulator with compatible AVD 'Android41' [2014-01-13 18:07:28 - Crystal Ball] Launching a new emulator with Virtual Device 'Android41' [2014-01-13 18:07:48 - Crystal Ball] New emulator found: emulator-5554 [2014-01-13 18:07:48 - Crystal Ball] Waiting for HOME ('android.process.acore') to be launched... [2014-01-13 18:12:55 - Crystal Ball] HOME is up on device 'emulator-5554' [2014-01-13 18:12:55 - Crystal Ball] Uploading Crystal Ball.apk onto device 'emulator-5554' [2014-01-13 18:12:55 - Crystal Ball] Installing Crystal Ball.apk... [2014-01-13 18:15:13 - Crystal Ball] Failed to install Crystal Ball.apk on device 'emulator-5554! [2014-01-13 18:15:13 - Crystal Ball] (null) [2014-01-13 18:15:13 - Crystal Ball] Launch canceled!

Sorry I couldn't make it look as neat as yours, -.-

Try this. Open the AVD Manager, and make sure your device has a green check next to it. If not, click the Details button to see what the error is. Assuming you have the green check mark, highlight your device, and click Start. Make sure the Launch from snapshot box is checked in the next window, then click Launch and wait a few minutes. Does the emulator launch? If not, what does it say in the "Starting Android Emulator" window that popped up after you clicked Start?

The emulator didn't launch. In the "Starting Android Emulator" window this is the message that I received:

Starting emulator for AVD 'Android41' emulator: ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration.

.

That error happens when your emulator doesn't shut down correctly. It can happen if you force close your emulator or close it before it's finished launching. The only way I know of to fix that is is to delete your existing emulator and create a new one. Here's a screenshot of what my emulator looks like, in case that helps you when you create a new one http://imgur.com/V6XmmsA. Once you've deleted your current emulator and created a new one, try launching that from the AVD Manager. If that works, you should be able to run your program in Eclipse.

Now I'm getting this: (I changed the name a few hours ago to see if that would work. Nope.)

[2014-01-13 20:33:56 - Krystal Ball] The connection to adb is down, and a severe error has occured. [2014-01-13 20:33:56 - Krystal Ball] You must restart adb and Eclipse. [2014-01-13 20:33:56 - Krystal Ball] Please ensure that adb is correctly located at 'C:\Users\Michael\TeamTreeHouse Android Eclipse Package\android_dev_environment\android-sdk-windows\platform-tools\adb.exe' and can be executed.

And that file is there.

Try restarting your computer. There may be some stuff left running in the background from when your emulator's snapshot was broken. Once your computer is restarted, delete your existing emulator(s), create a new one, and try to start that new one from the AVD Manager (not by running your Crystal Ball app). Let me know how that goes.

All right, I did all of that, and the emulator is back up and running, except it's still doing the same as before, where it was taking me to the lock/home screen, with the console box telling me:

[2014-01-13 21:24:29 - Krystal Ball] Failed to install Krystal Ball.apk on device 'emulator-5554! [2014-01-13 21:24:29 - Krystal Ball] (null) [2014-01-13 21:24:29 - Krystal Ball] Launch canceled!

The green check mark was there and the snapshot was enabled.

Post all of the errors that's are in the LogCat window in Eclipse. You can shown only errors if you change the drop down from "verbose" to "error". I know that's a lot of stuff in that window, but that window shows errors that the Console doesn't. Take a look at the markdown cheatsheet on this page to see how to format stuff as code. That'll make it easier to read.

Also, post whatever it says in your DDMS Console window. You can show the DDMS messages by going to the Console window, clicking on the little icon in the upper right that looks like a computer monitor, and selecting DDMS.

This is just a practice run! I'll have the DDMS and LogCat (error only) up shortly. I appreciate your help. I've been at this all day. Figured it's my off day, I'l get some studying in, 9 hours later, still haven't even made it passed this quirk. Anyways, this is just the console output. I'll have the other two when the emulator is done running.

<p>[2014-01-13 21:50:25 - Krystal Ball] ------------------------------ 
[2014-01-13 21:50:25 - Krystal Ball] Android Launch! 
[2014-01-13 21:50:25 - Krystal Ball] adb is running normally. 
[2014-01-13 21:50:25 - Krystal Ball] Performing com.example.krystal.ball.MainActivity activity launch 
[2014-01-13 21:50:25 - Krystal Ball] Automatic Target Mode: launching new emulator with compatible AVD 'Android41' 
[2014-01-13 21:50:25 - Krystal Ball] Launching a new emulator with Virtual Device 'Android41' 
[2014-01-13 21:50:28 - Krystal Ball] New emulator found: emulator-5554 
[2014-01-13 21:50:28 - Krystal Ball] Waiting for HOME ('android.process.acore') to be launched... 
[2014-01-13 21:55:02 - Krystal Ball] HOME is up on device 'emulator-5554' 
[2014-01-13 21:55:02 - Krystal Ball] Uploading Krystal Ball.apk onto device 'emulator-5554' 
[2014-01-13 21:55:02 - Krystal Ball] Installing Krystal Ball.apk... 
[2014-01-13 21:57:14 - Krystal Ball] Failed to install Krystal Ball.apk on device 'emulator-5554! 
[2014-01-13 21:57:14 - Krystal Ball] (null) 
[2014-01-13 21:57:15 - Krystal Ball] Launch canceled!</p>
Ben Jakuben
Ben Jakuben
Treehouse Teacher

Really sorry that you're having such trouble with this. I had similar issues back when I started and was quite dissatisfied with the emulator. :-/

If you're still having trouble, check out Genymotion, which I recently released a stage about.

Yeah, it's always annoying when these things eat up hours and hours. I ran into similar problems a lot when I was first starting with Android.

As long as you're uploading things, could you upload a screenshot of your virtual device configuration?