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 Build a Simple Android App (retired 2014) Getting Started with Android Android Setup and the Crystal Ball Project

Crystal Ball Not Running on the Emulator at the end of following the video tutorial for Android Setup

So following along with the Android Setup video tutorial everything seems to be going fine until I try to run Crystal Ball on the emulator. First off, if I click on Run As Android Application as he shows in the video nothing happens at all. If I instead click on Crystal Ball while in the Run panel it starts to launch. Everything seems to be fine in the Console but then it switches over to the LogCat and then the emulator itself says "Unfortunately, Crystal Ball has stopped". I'm not sure why it's doing this so any help would be appreciated. Thank you in advance!

I am having a similar issue, except I can't get it to launch at all. I followed all of the instructions. There are no visible errors, warnings or other problems for me. When I click on Run as Android Application, absolutely nothing happens.

Nice to know I'm not the only one. I haven't had any further luck with it yet, so it's a bit of a discouraging start to learning Android. If I don't get any answers soon I'll probably try posting my question again at the end of the week.

3 Answers

Kiersten,

I fixed my issue. I wasn't having the "Unfortunately, Crystal Ball has stopped." part of the problem, but I was getting the no connection part and this is how I resolved it. Maybe this will help you.

I started with a fresh install of the development bundle supplied by Treehouse. I don't know if that was necessary, but I did it.

Follow the instructions up until the part where you run the project. Instead of doing it like it is in the video, I went to Package Explorer on the left, went to Crystal Ball > res > layout > fragment_main.xml. Right click on that file and choose Run As > 1 Android Application. This worked properly for me.

Alternatively, check your run configuration. What doing the above did was create a run configuration for me, but you may be able to check yours and modify it (or create one from scratch if the above doesn't work). If you are using the run button on the toolbar, hit the arrow and under Run As it has an option for run configurations. See if there is anything under Android Applications. Now that mine is working I have a configuration named CrystalBall. Under the first tab (Android) the project is CrystalBall and the Launch Action is "Launch Default Activity". On the target tab make sure the option "Automatically pick compatible device:..." is selected. You don't need to have a device checked but you can.

Good luck.

Thank you for your help! Unfortunately, I'm still having problems. I followed your directions but it still starts to launch but then encounters some kind of fatal exception and informs me that Crystal Ball has stopped. I don't know if it will help show what's going on, but this is the first part of what it displays in the LogCat:

06-11 23:46:44.395: W/dalvikvm(1067): VFY: unable to resolve static field 1559 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable; 06-11 23:46:44.395: D/dalvikvm(1067): VFY: replacing opcode 0x62 at 0x0004 06-11 23:46:44.425: D/AndroidRuntime(1067): Shutting down VM 06-11 23:46:44.425: W/dalvikvm(1067): threadid=1: thread exiting with uncaught exception (group=0xb1a66ba8) 06-11 23:46:44.435: E/AndroidRuntime(1067): FATAL EXCEPTION: main 06-11 23:46:44.435: E/AndroidRuntime(1067): Process: com.example.crystalball, PID: 1067 06-11 23:46:44.435: E/AndroidRuntime(1067): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable

Unfortunately I'm too new at this to offer much insight. The only other thing I noticed is that windows apparently has a soft memory restriction when it comes to AVDs. If you're running windows, check to see that the AVD you're using has its RAM set to 768 or less (or make a new one and be sure to have that as the limit). That's just a guess.

I'm having the same problem. The AVD says "Unfortunately, Crystal Ball has stopped." Loads of exceptions/errors.