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) Pretty Little Things Customizing Buttons and Labels

App is not working!

when I am trying to run my app, an error message is dispplaying which reads "Unfortunately, Crystal Ball has stoped working!". Can anyone help?

4 Answers

Calvin Nix
Calvin Nix
43,828 Points

The logs you provided indicate that the theme you are using is incompatible. "You need to use a Theme.AppCompat theme (or descendant) with this activity. " Change the theme that you are currently using and retest.

Calvin Nix
Calvin Nix
43,828 Points

Hey Zeeshan,

What are the error messages that you are receiving in logcat?

@Calvin Nix : These->

05-28 04:00:52.692: D/AndroidRuntime(1206): Shutting down VM 05-28 04:00:52.692: W/dalvikvm(1206): threadid=1: thread exiting with uncaught exception (group=0xb2a24ba8) 05-28 04:00:52.712: E/AndroidRuntime(1206): FATAL EXCEPTION: main 05-28 04:00:52.712: E/AndroidRuntime(1206): Process: com.example.crystalball, PID: 1206 05-28 04:00:52.712: E/AndroidRuntime(1206): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.crystalball/com.example.crystalball.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.ActivityThread.access$800(ActivityThread.java:135) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.os.Handler.dispatchMessage(Handler.java:102) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.os.Looper.loop(Looper.java:136) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.ActivityThread.main(ActivityThread.java:5017) 05-28 04:00:52.712: E/AndroidRuntime(1206): at java.lang.reflect.Method.invokeNative(Native Method) 05-28 04:00:52.712: E/AndroidRuntime(1206): at java.lang.reflect.Method.invoke(Method.java:515) 05-28 04:00:52.712: E/AndroidRuntime(1206): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 05-28 04:00:52.712: E/AndroidRuntime(1206): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 05-28 04:00:52.712: E/AndroidRuntime(1206): at dalvik.system.NativeStart.main(Native Method) 05-28 04:00:52.712: E/AndroidRuntime(1206): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:111) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98) 05-28 04:00:52.712: E/AndroidRuntime(1206): at com.example.crystalball.MainActivity.onCreate(MainActivity.java:16) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.Activity.performCreate(Activity.java:5231) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 05-28 04:00:52.712: E/AndroidRuntime(1206): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 05-28 04:00:52.712: E/AndroidRuntime(1206): ... 11 more 05-28 04:01:01.142: I/Process(1206): Sending signal. PID: 1206 SIG: 9

Thanx in advance man!!

Thanx a lot bro! It worked!

Calvin Nix
Calvin Nix
43,828 Points

Great! You're welcome!