1

Just downloaded Android studio and having some trouble. cant run the default hello world program. Seems to be related to API version numbers and proper linking? originally i had version 20 which is not for phones. i tried to change to ver 19

Start -computer- properties advanced system settings-environment variables reads: java_home C:program files/javajdk1.8.0_20 (also i may have changed something by accident: ComSpec c:windows/system32/cmd32)

from there i downloaded some thins from Android Studios:

       SDK manager"

sort by API i have all the API's that are 19 for some reason glass development preview does not install. I also have some things from API 20 and usb driver and repository (rev 6) google play rev 19 google usb driver rev 10

RUN when i click run ... i choose nexus 7 (the only one there) the phone screen opens and then reads android while it loads

Waiting for device. log ....

          "C:...\AppData\Local\Android\android-studio1\sdk\tools\emulator.exe" -avd nexus7             -netspeed full -netdelay none
       Device connected: emulator-5554
       Device nexus7 [emulator-5554] is online, waiting for processes to start up..
       Device nexus7 [emulator-5554] is online, waiting for processes to start up..
       Device nexus7 [emulator-5554] is online, waiting for processes to start up..
       Device nexus7 [emulator-5554] is online, waiting for processes to start up..
       Device nexus7 [emulator-5554] is online, waiting for processes to start up..

___________the phone starts working with time in upper right there is no text ________

         Device nexus7 [emulator-5554] is online, waiting for processes to start up..
         Device nexus7 [emulator-5554] is online, waiting for processes to start up..
         Device nexus7 [emulator-5554] is online, waiting for processes to start up..
         Device nexus7 [emulator-5554] is online, waiting for processes to start up..

screen dims and then lights up when i "slide " i rerun it and choose open nexus 7

Device nexus7

e"log cat log reads....
      09-15 22:56:52.200      777-777/com.example.******.myapplication D/AndroidRuntime﹕            Shutting down VM
      09-15 22:56:52.200      777-777/com.example.******.myapplication W/dalvikvm﹕ threadid=1:    thread exiting with uncaught exception (group=0xb3a81d70)
        09-15 22:56:52.230      777-777/com.example.******.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.******.myapplication, PID: 777
java.lang.RuntimeException: Unable to start activity                                         ComponentInfo{com.example.******.myapplication/com.example.******.myapplication.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.example.******.myapplication.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)

e

Sorry im totally new to all this and not sure what to post. I did not touch any of the code it is all the default.

Cœur
  • 37,241
  • 25
  • 195
  • 267
user4044301
  • 13
  • 1
  • 6
  • duplicate of http://stackoverflow.com/questions/24587218/android-util-androidruntimeexception-you-cannot-combine-swipe-dismissal-and-the – CommonsWare Sep 15 '14 at 23:41
  • gradle :apply plugin: 'com.android.application' android { compileSdkVersion 20 buildToolsVersion "20.0.0" defaultConfig { applicationId "com.example.imrankarmali.myapplication" minSdkVersion 19 targetSdkVersion 20 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) } – user4044301 Sep 15 '14 at 23:45
  • Tried to change all the 20's to 19's it asked for to sync: Gradle project syc failed. basic functionality (eg editing,debug) will not work propely. – user4044301 Sep 15 '14 at 23:47

2 Answers2

0

This seems like known issue for the error "You cannot combine swipe dismissal and the action bar."

It tells like this:

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.

To change AVD target

Open AVD Manager Tools->Android->AVD Manager.

enter image description here

Community
  • 1
  • 1
Chk0nDanger
  • 1,211
  • 1
  • 10
  • 26
  • what is your emulator's API level? Is it android phone or android wear? – Chk0nDanger Sep 16 '14 at 03:53
  • Open AVD Manager by clicking Tools->Android->AVD Manager. Click current emulator, press "Edit" button and change the "Target" if it is "Android 4.4W - API Level 20". – Chk0nDanger Sep 16 '14 at 04:01
  • I set it for 19 like you suggested in project structure. So i guess its 19. unless i have to something else. The thing i dont get is why do i have to change each new project manifest.xml from ndroid:theme="@style/AppTheme" > to android:theme="@android:style/Theme.DeviceDefault" Why is it set at the wrong line ? – user4044301 Sep 16 '14 at 04:02
  • Im kinda scared that though it works now it is still not set up correctly, you know what i mean – user4044301 Sep 16 '14 at 04:03
  • I was misunderstood before, actually you have to change Emulator's Target to level 19 not the project's target. however you solved problem, I am assuming you may not run emulator in proper phone device mode. but I am not sure. – Chk0nDanger Sep 16 '14 at 04:24
  • Thanks Ill look in to it. but i feel that there is a bigger problem and it will keep kicking me in the but every few hours. Already the small phone on right window failed. I just dont understand why all programs need to be so complicated to install. Why cant it be like installing other non programming programs. I can see alot of people shy away from the industry just cause its so hard to actually get the programming. I am not only picking android alone. I once tried R and gave up also. Worst part is that reinstalling usually does not help. I already tried. – user4044301 Sep 16 '14 at 05:01
0

After changing the values mentioned above by Chk0nDanger I then did the following found by another poster.. This seems to have fixed the problem.

Thanks guys !

I had the same issue. But sdk version was not the cause for this exception.

In the AndroidManifest.xml file you have the theme has ActionBar in it.

android:theme="@style/AppTheme" >

Change the above line to

android:theme="@android:style/Theme.DeviceDefault" >

That will fix the exception.

user4044301
  • 13
  • 1
  • 6