0

I am new to Android development and was a following the book Head first Android development.Everything works fine, all my code and xml changes are being reflected on Graphical layout on eclipse screen. But my Emulator never works at all, it just appears as a blank black screen and not same as the screen shown in Graphical layout. No project name , no hello world, nothing appears on emulator screen. Sometimes the screen is black while sometimes its with a colorful background but nothing relevant to my code.

1.I have tried many AVDs of varying android API version. 2.I have tried replacing SDK package several times. 3.I have tried with eclipse ADT package provided for google. 4.I have tried changing ADTs and even changed entire eclipse. 5.Changing memory card, RAM, snapshot, Camera nothing works for me. 6.Although I dont know intellij but still I tried Android studio that too didn't work out.

Please guys let me know what and where am I missing something??

Or if possible can I run and test my .apk on my android 4.2.2 smartphone?

this is what i get in logs

[2014-07-31 21:08:32 - Deepu] Android Launch!
[2014-07-31 21:08:32 - Deepu] adb is running normally.
[2014-07-31 21:08:32 - Deepu] Performing com.tcs.deepu.MainActivity activity launch
[2014-07-31 21:08:45 - Deepu] Launching a new emulator with Virtual Device 'tester'
[2014-07-31 21:10:05 - Emulator] creating window 0 0 456 729
[2014-07-31 21:10:06 - Emulator] emulator: emulator window was out of view and was recentered
[2014-07-31 21:10:06 - Emulator] 
[2014-07-31 21:10:06 - Deepu] New emulator found: emulator-5554
[2014-07-31 21:10:06 - Deepu] Waiting for HOME ('android.process.acore') to be launched...
[2014-07-31 21:10:58 - Deepu] HOME is up on device 'emulator-5554'
[2014-07-31 21:10:58 - Deepu] Uploading Deepu.apk onto device 'emulator-5554'
[2014-07-31 21:10:59 - Deepu] Installing Deepu.apk...
[2014-07-31 21:13:04 - Deepu] Failed to install Deepu.apk on device 'emulator-5554!
[2014-07-31 21:13:04 - Deepu] (null)
[2014-07-31 21:13:04 - Deepu] Launch canceled!

and here is what appears in logcat

07-31 16:55:09.000: D/dalvikvm(764): Not late-enabling CheckJNI (already on)
07-31 16:55:09.440: D/AndroidRuntime(764): Shutting down VM
07-31 16:55:09.440: W/dalvikvm(764): threadid=1: thread exiting with uncaught exception (group=0xb1acad70)
07-31 16:55:09.530: E/AndroidRuntime(764): FATAL EXCEPTION: main
07-31 16:55:09.530: E/AndroidRuntime(764): Process: com.saurabh.app, PID: 764
07-31 16:55:09.530: E/AndroidRuntime(764): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.saurabh.app/com.saurabh.app.MainActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.ActivityThread.access$800(ActivityThread.java:138)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.os.Handler.dispatchMessage(Handler.java:102)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.os.Looper.loop(Looper.java:136)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.ActivityThread.main(ActivityThread.java:5026)
07-31 16:55:09.530: E/AndroidRuntime(764):  at java.lang.reflect.Method.invokeNative(Native Method)
07-31 16:55:09.530: E/AndroidRuntime(764):  at java.lang.reflect.Method.invoke(Method.java:515)
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-31 16:55:09.530: E/AndroidRuntime(764):  at dalvik.system.NativeStart.main(Native Method)
07-31 16:55:09.530: E/AndroidRuntime(764): Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.Activity.setContentView(Activity.java:1930)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:217)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:110)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:77)
07-31 16:55:09.530: E/AndroidRuntime(764):  at com.saurabh.app.MainActivity.onCreate(MainActivity.java:13)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.Activity.performCreate(Activity.java:5242)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-31 16:55:09.530: E/AndroidRuntime(764):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-31 16:55:09.530: E/AndroidRuntime(764):  ... 11 more
Saurabh
  • 159
  • 4
  • 17
  • possible duplicate of [How to create an AVD for Android 4.0](http://stackoverflow.com/questions/7817044/how-to-create-an-avd-for-android-4-0) – Maveňツ Jul 31 '14 at 06:05

1 Answers1

0

Your question is not too clear but from what I understand it seems that one of the following is happening:

Your application is not being installed on the emulator

OR

Your application is being installed but you just cannot find it on the emulator.

If you are using Android Studio do the following:

Run->Select AVD. This should start your emulator. Wait until the familiar Android Lock Screen loads onto your emulator. Then open the launcher and navigate it till you find your applications logo and open it.

The emulator is not like a console which immediately opens up the application's main activity but instead starts a virtual machine of the Android Operating System. Your application gets installed onto this virtual machine like any other app would when downloaded from the Play Store onto an Android phone.

Follow this tutorial if you need additional help: http://www.vogella.com/tutorials/Android/article.html

Community
  • 1
  • 1
Banach Tarski
  • 1,821
  • 17
  • 36
  • yes..basically my .apk is not being installed on my emulator. Any solution in that case?? – Saurabh Jul 31 '14 at 07:07
  • Try installing in your Android smartphone for the time being. For Android Studio go to the folder AndroidStudioProjects/AppName/app/build/apk and copy paste the file called app-debug-unaligned.apk to your phone and install it. But you will have a hard time debugging the app. – Banach Tarski Jul 31 '14 at 09:13
  • Thanks VastoLorde95, but now I have my app in eclipse and not in Android Studio.Can u please tell me the way to run my app in my phone using my eclipse version of app. – Saurabh Jul 31 '14 at 09:39