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 trialElle Inad
568 PointsUnfortunately, Fun Facts has stopped.
Unfortunately, the Fun Facts app didn't load in the emulator.
Below are the error messages received: The cause may be indicated by this statement in the list below ? ** Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.**
08-02 13:46:59.194 6023-6023/? I/art﹕ Not late-enabling -Xcheck:jni (already on) 08-02 13:47:01.174 6023-6030/com.dariusus.funfacts W/art﹕ Suspending all threads took: 47.476ms 08-02 13:47:01.529 6023-6023/com.dariusus.funfacts D/AndroidRuntime﹕ Shutting down VM 08-02 13:47:01.592 6023-6030/com.dariusus.funfacts W/art﹕ Suspending all threads took: 24.464ms 08-02 13:47:01.610 6023-6023/com.dariusus.funfacts E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.dariusus.funfacts, PID: 6023 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dariusus.funfacts/com.dariusus.funfacts.FunFactsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:124) at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146) at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59) at com.dariusus.funfacts.FunFactsActivity.onCreate(FunFactsActivity.java:13) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
1 Answer
Costin-Alexandru Zaharia
1,509 PointsI have the same problem. changing to "Theme.AppCompat.Light" does resolve it but why can't I change the theme?
Elle Inad
568 PointsElle Inad
568 PointsSolution found here https://teamtreehouse.com/forum/you-need-to-use-a-themeappcompat-theme-or-descendent-crystal-ball-crashes
Just go into styles.xml and change the AppTheme back to Theme.AppCompat.Light
Problem solved.