0

I recently installed the ADT/Eclipse bundle on Windows 7 (64 bit). Whenever I try to run an application on the emulator it just says "Unfortunately, app has stopped". I've searched this error and read through loads of fixes on this site and others, but all of them seemed to be having trouble with a particular bit of code.

This error is happening without me making any changes to the code. I've tried it with multiple projects, with different minimum and target SDKs, to get the same result.

Here is my logcat log of the problem.

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

So I'm assuming there must be some problem with something I've set up, but I've no idea.

Thanks in advance.

Xaver Kapeller
  • 49,491
  • 11
  • 98
  • 86
dahui
  • 2,128
  • 2
  • 21
  • 40
  • The error message seems pretty clear: `You cannot combine swipe dismissal and the action bar`. – Xaver Kapeller Jul 09 '14 at 11:32
  • Fair, but I didn't attempt to integrate either of these things, so why would a default Android project combine things that shouldn't be together? – dahui Jul 09 '14 at 11:34

2 Answers2

1

Try using

android:targetSdkVersion="19"

if you are using

android:targetSdkVersion="20"

There is some problem API level 20. Here is a similar issue.

Community
  • 1
  • 1
  • My min version is 11, and I've tried it with a few variations now, same problem. – dahui Jul 09 '14 at 11:36
  • Changed the version in the manifest, same error. Made a new project with target version 19, same error, – dahui Jul 09 '14 at 11:42
  • Okay I sorted it, turns out I didn't actually have an earlier SDK downloaded. Fail on my behalf, although I still think it is stupid that the android studio prevents you compiling on the default application with the latest version. – dahui Jul 11 '14 at 14:00
1

Try changing target sdk version to 19

Do not use API Level of 20 and Platform 4.4W, as Android Virtual Device. With Level 19 and Platform 4.2.2 set on ADV everything runs as it should. From here

Note: After changing clean your project.

Community
  • 1
  • 1
Giru Bhai
  • 14,370
  • 5
  • 46
  • 74
  • it's good to tell source of answer ( http://stackoverflow.com/questions/24587218/android-util-androidruntimeexception-you-cannot-combine-swipe-dismissal-and-the) – Shayan Pourvatan Jul 09 '14 at 11:44
  • Tried changing it and also making a new project with the target version, same error. I can't seem to create an AVD not using "Android 4.4W API Level 20", or "Android L (Preview) API Level L". – dahui Jul 09 '14 at 11:45