Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

Unfortunately app has stopped

I tried using my AVD but this error kept on coming up. PS I did not even touch the code. Please help

Thanks.

My Logcat is as follows :

09-01 03:46:53.650 775-775/com.adhastudio.test D/AndroidRuntime﹕ Shutting down VM 09-01 03:46:53.650 775-775/com.adhastudio.test W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb3a17d70) 09-01 03:46:53.660 775-775/com.adhastudio.test E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.adhastudio.test, PID: 775 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.adhastudio.test/com.adhastudio.test.MyActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258) at android.app.ActivityThread.access$800(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5026) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) at dalvik.system.NativeStart.main(Native Method) Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar. at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275) at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872) at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303) at android.app.Activity.setContentView(Activity.java:1930) at com.adhastudio.test.MyActivity.onCreate(MyActivity.java:14) at android.app.Activity.performCreate(Activity.java:5242) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)             at android.app.ActivityThread.access$800(ActivityThread.java:138)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:136)             at android.app.ActivityThread.main(ActivityThread.java:5026)             at java.lang.reflect.Method.invokeNative(Native Method)             at java.lang.reflect.Method.invoke(Method.java:515)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)             at dalvik.system.NativeStart.main(Native Method)

Harry James
Harry James
14,780 Points

Hello, what project are you working on could I ask?

5 Answers

Harry James
Harry James
14,780 Points

EDIT: I think I found the issue. In the Android Manifest, change the targetSdkVersion to

android:targetSdkVersion="19"

Then this will work. The reason you're having the problem is because the SDK version you are currently targeting is for Android Wear (The smartwatch) but, you actually want to create a mobile application.

Option 2 is to set the targetSdkVersion to 21 and use the Android L Developer Preview. It's up to you :)

Its the first project . I think its called Fun Facts

Hi Harry,

I went to the Android Manifest tab, but I cant seem to find the

android:targetSdkVersion="xx" line

Could you help me here please ?

Adnan

Harry James
Harry James
14,780 Points

Hello, sorry, open up the Android Manifest file and then switch to the XML View tab and you'll find it :)

Harry ... Thanks the help...

BTW ... Sorry about the point system thingy I totally thought it was an arrow key for me to scroll down

Hi Harry,

The code in my Android Manifest xml tab is as follows There is no android:targetSdkVersion="19" target in the code BTW I am using Android Studio (could that be one of the factors for the emulator not booting up ?:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adhastudio.test2" >

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MyActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

Harry James
Harry James
14,780 Points

Ah. If you are using Android Studio, it's a little bit different. Instead, take a look in your main build.gradle file and change the values there:

compileSdkVersion 19
    buildToolsVersion "19.1.0"

Hope it helps!