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

Andrii Prykhodko
Andrii Prykhodko
413 Points

Android device emulator doesn't run the app

Here's the list of erros from LogCat: 07-31 11:33:08.490: E/logwrapper(39): executing /system/bin/e2fsck failed: No such file or directory 07-31 11:33:08.520: E/logwrapper(42): executing /system/bin/e2fsck failed: No such file or directory 07-31 11:33:09.510: E/cutils(54): Failed to read /data/.layout_version: No such file or directory 07-31 11:33:11.210: E/SurfaceFlinger(50): hwcomposer module not found 07-31 11:33:12.080: E/SurfaceFlinger(50): ro.sf.lcd_density must be defined as a build property 07-31 11:33:12.850: E/AudioFlinger(53): int android::load_audio_interface(const char*, audio_hw_device_t**) couldn't load audio hw module audio.r_submix (No such file or directory) 07-31 11:33:17.100: E/memtrack(51): Couldn't load memtrack module (No such file or directory) 07-31 11:33:17.100: E/android.os.Debug(51): failed to load memtrack module: -2 07-31 11:33:25.370: E/EmojiFactory_jni(51): Failed to load libemoji.so: dlopen failed: library "libemoji.so" not found

Andrii Prykhodko
Andrii Prykhodko
413 Points

tried on different virtual devices: now it says: "Unfortunately, Crystal Ball has stopped".

LogCat gives the following mistakes:

07-31 07:47:29.030: W/dalvikvm(833): threadid=1: thread exiting with uncaught exception (group=0xb4ae5ba8) 07-31 07:47:29.070: E/AndroidRuntime(833): FATAL EXCEPTION: main 07-31 07:47:29.070: E/AndroidRuntime(833): Process: com.example.crystalball, PID: 833 07-31 07:47:29.070: E/AndroidRuntime(833): 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. 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.ActivityThread.access$800(ActivityThread.java:135) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.os.Handler.dispatchMessage(Handler.java:102) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.os.Looper.loop(Looper.java:136) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.ActivityThread.main(ActivityThread.java:5017) 07-31 07:47:29.070: E/AndroidRuntime(833): at java.lang.reflect.Method.invokeNative(Native Method) 07-31 07:47:29.070: E/AndroidRuntime(833): at java.lang.reflect.Method.invoke(Method.java:515) 07-31 07:47:29.070: E/AndroidRuntime(833): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 07-31 07:47:29.070: E/AndroidRuntime(833): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 07-31 07:47:29.070: E/AndroidRuntime(833): at dalvik.system.NativeStart.main(Native Method) 07-31 07:47:29.070: E/AndroidRuntime(833): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 07-31 07:47:29.070: E/AndroidRuntime(833): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:111) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98) 07-31 07:47:29.070: E/AndroidRuntime(833): at com.example.crystalball.MainActivity.onCreate(MainActivity.java:16) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.Activity.performCreate(Activity.java:5231) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 07-31 07:47:29.070: E/AndroidRuntime(833): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 07-31 07:47:29.070: E/AndroidRuntime(833): ... 11 more

Justin Horner
Justin Horner
Treehouse Guest Teacher

Hello Andrii,

I believe the relevant piece of information is this.

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.

There could be a mismatch between the theme that is set and the class that MainActivity derives from. Does your MainActivity class derive from Activity?

Andrii Prykhodko
Andrii Prykhodko
413 Points

Hi Justin!

Thanks for looking at my issue. But I have just started with programming and this sounds more like rocket science) Could you please tell me what should i change and in which file?

Thanks again!

Best, A

2 Answers

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

No problem! I'll do my best to help.

Firstly, we need to know more about your MainActivity class, since this seems like the source of the problem.

Make sure MainActivity extends Activity. If it extends anything else such as ActionBarActivity, change it to extend Activity. So your result should look something like this.

public class MainActivity extends Activity

If this isn't the problem let me know and we'll take the next step.

Andrii Prykhodko
Andrii Prykhodko
413 Points

You are a genius!!! It works now!!!!!! Thanks!

Initially it was public class MainActivity extends ActionBarActivity

Huge thanks!!!!