Metalhead1247
Metalhead1247

Reputation: 1978

Have to open emulator 3 times to get the app running every time i open eclipse

when I open eclipse and all files are loaded and I run my app, the emulator opens after which I get an error in console.

So Again when I close the emulator and run the app again, I get the same error in console.

And finally the third time when I run the app, it gets installed and launches the apk. This happens every time I open eclipse.

What is the problem?

Console logs:

        [2013-06-01 20:10:58 - CalendarDemo] ------------------------------
   [2013-06-01 20:10:58 - CalendarDemo] Android Launch!
[2013-06-01 20:10:58 - CalendarDemo] adb is running normally.
[2013-06-01 20:10:59 - CalendarDemo] Performing com.indianic.demo.calendark.CalendarActivity activity launch

 [2013-06-01 20:10:59 - CalendarDemo] Automatic Target Mode: Preferred AVD '53' is not available. Launching new emulator.
      [2013-06-01 20:10:59 - CalendarDemo] Launching a new emulator with Virtual Device '53'
[2013-06-01 20:11:29 - Emulator] Failed to create Context 0x3005
 [2013-06-01 20:11:29 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
[2013-06-01 20:11:30 - Emulator] emulator: emulator window was out of view and was recentered
 [2013-06-01 20:11:30 - Emulator] 
  [2013-06-01 20:11:30 - CalendarDemo] New emulator found: emulator-5554
    [2013-06-01 20:11:30 - CalendarDemo] Waiting for HOME ('android.process.acore') to be launched...
  [2013-06-01 20:12:46 - CalendarDemo] emulator-5554 disconnected! Cancelling 'com.indianic.demo.calendark.CalendarActivity activity launch'!
     [2013-06-01 20:19:55 - CalendarDemo] ------------------------------
      [2013-06-01 20:19:55 - CalendarDemo] Android Launch!
      [2013-06-01 20:19:55 - CalendarDemo] adb is running normally.
         [2013-06-01 20:19:55 - CalendarDemo] Performing com.indianic.demo.calendark.CalendarActivity activity launch
   [2013-06-01 20:19:55 - CalendarDemo] Automatic Target Mode: Preferred AVD '53' is not available. Launching new emulator.
    [2013-06-01 20:19:55 - CalendarDemo] Launching a new emulator with Virtual Device '53'
     [2013-06-01 20:20:20 - Emulator] Failed to create Context 0x3005
   [2013-06-01 20:20:20 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
  [2013-06-01 20:20:21 - Emulator] emulator: emulator window was out of view and was recentered

    [2013-06-01 20:20:21 - Emulator] 
[2013-06-01 20:20:21 - CalendarDemo] New emulator found: emulator-5554
[2013-06-01 20:20:21 - CalendarDemo] Waiting for HOME ('android.process.acore') to be launched...
     [2013-06-01 20:21:14 - CalendarDemo] HOME is up on device 'emulator-5554'
 [2013-06-01 20:21:14 - CalendarDemo] Uploading CalendarDemo.apk onto device 'emulator-5554'
[2013-06-01 20:21:16 - CalendarDemo] Installing CalendarDemo.apk...
[2013-06-01 20:22:18 - CalendarDemo] Success!

Upvotes: 1

Views: 573

Answers (2)

Metalhead1247
Metalhead1247

Reputation: 1978

Go to window->Preferences->Android->DDMS.

change value of adb timeout to 10000.

Since it takes a lot of time for emulator to start, adb times out and the connection is lost
hence the app is not installed.

Upvotes: 0

Mehul Joisar
Mehul Joisar

Reputation: 15358

Try this

First of all, start your desired emulator and then do following steps,

Step 1: Right click on your project -> Run As -> Run Configurations

Step 2: There will be 3 tabs, Android | Target | Common , click on Target

Step 3: In Deployment Target Selection Mode, select the first option which is Always prompt to pick device

Step 4: Click on Apply and then click on Run

As the result, you will get list of currently available devices, you can select desired device and can run the app on it.

I hope it will be helpful !!

Upvotes: 1

Related Questions