Android emulator in Eclipse does not work? - android

I have made a new AVD, created a new Blank Activity. The AVD is configured for Android 4.2.2, API level 17 and so is the blank activity.
However the log, when I run the activity, is this:
[2013-06-30 02:33:38 - myfirstapp] ------------------------------
[2013-06-30 02:33:38 - myfirstapp] Android Launch!
[2013-06-30 02:33:38 - myfirstapp] adb is running normally.
[2013-06-30 02:33:38 - myfirstapp] Performing com.example.myfirstapp.MainActivity activity launch
[2013-06-30 02:33:38 - myfirstapp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2013-06-30 02:33:41 - myfirstapp] Launching a new emulator with Virtual Device 'HelloEmulator'
[2013-06-30 02:33:48 - myfirstapp] New emulator found: emulator-5556
[2013-06-30 02:33:48 - myfirstapp] Waiting for HOME ('android.process.acore') to be launched...
It launches some different, large-screen, emulator.
What have I done wrong?

There are two steps during launching your application with Android Virtual Device. First, launching the virtual device and second launching your application. If the virtual device is not already launched, it takes 3-4 min to be launched. During this step, the following message as you described above appears:
[2013-06-30 02:33:48 - myfirstapp] Waiting for HOME ('android.process.acore') to be launched...
Launching application is faster than launching the android virtual device.

evrey thing is going normal just wait
and to post emulator speed up you may check use GPU host and put ram size 850

Related

Failed to install MyFirstApp.apk (Hello World!) on device

First, sorry for my ignorance. I'm trying to make the HelloWorld app run following step by step the tutorial here.
I can't load the app, as Android keeps showing me the message:
[2014-05-26 15:56:38 - MyFirstApp] Android Launch!
[2014-05-26 15:56:38 - MyFirstApp] adb is running normally.
[2014-05-26 15:56:38 - MyFirstApp] Performing mypackage.myfirstapp.MainActivity activity launch
[2014-05-26 15:56:38 - MyFirstApp] Automatic Target Mode: launching new emulator with compatible AVD 'MyNexusOne'
[2014-05-26 15:56:38 - MyFirstApp] Launching a new emulator with Virtual Device 'MyNexusOne'
[2014-05-26 15:56:38 - MyFirstApp] New emulator found: emulator-5554
[2014-05-26 15:56:38 - MyFirstApp] Waiting for HOME ('android.process.acore') to be launched...
[2014-05-26 15:57:02 - MyFirstApp] Android Launch!
[2014-05-26 15:57:02 - MyFirstApp] adb is running normally.
[2014-05-26 15:57:02 - MyFirstApp] Performing mypackage.myfirstapp.MainActivity activity launch
[2014-05-26 15:57:02 - MyFirstApp] Uploading MyFirstApp.apk onto device 'emulator-5554'
[2014-05-26 15:57:02 - MyFirstApp] Failed to install MyFirstApp.apk on device 'emulator-5554': No such file or directory
[2014-05-26 15:57:02 - MyFirstApp] com.android.ddmlib.SyncException: No such file or directory
[2014-05-26 15:57:02 - MyFirstApp] Launch canceled!
At the beginning, I have the same problem like in this question:
Waiting for HOME ('android.process.acore') to be launched
So I did as the suggested answer, "right click on the project and click run as Android application once again". At the first time, Android showed me a window to select the device, which I chose the only one available 'emulator-5554'. After choosing and running, Android showed me the message above. From the second time I run it, Android showed me directly the message, and didn't show the window to choose the emulator again.
It seems I have the same problem like in this question:
com.android.ddmlib.SyncException: No such file or directory
But none of the answers work for me.
In a desperate attempt, I already changed the ADB connection timeout to 10000ms.
Looks like the apk is build without any issues but when eclipse is trying to install, it is not finding the "MyFirstApp.apk".
Make sure the generated .apk file is in the "bin" directory. OR the eclipse is trying to read it from some other path.
Saw this question while trying to research why mine did the same thing. When I changed the Eclipse 'Run Configurations' option from 'Launch Default Activity' to Launch 'com.example.myfirstapp.MyActivity', the project was installed on the Android virtual device and happily loaded and ran properly. Took a very, very long time to load the Virtual Device, as others have said.

Why is the emulator in eclipse restarting?

I am following http://developer.android.com/training/basics/firstapp/running-app.html
and trying to run my first android app on the emulator on my PC.
The emulator is running (started from eclipse)
I managed to lauch myFirst App via eclipse as described, although in this tutorial it should be added you have to wait minutes before the emulator is up and running.
Now my problem is that when I modify myFirstApp, and wnat to test it, that eclipse keeps starting a new emulator:
[2012-10-15 19:32:44 - MyFirstApp] ------------------------------
[2012-10-15 19:32:44 - MyFirstApp] Android Launch!
[2012-10-15 19:32:44 - MyFirstApp] adb is running normally.
[2012-10-15 19:32:45 - MyFirstApp] Performing com.example.myfirstapp.MainActivity activity launch
[2012-10-15 19:32:45 - MyFirstApp] Automatic Target Mode: Preferred AVD 'Hobbit' is not available. Launching new emulator.
[2012-10-15 19:32:45 - MyFirstApp] Launching a new emulator with Virtual Device 'Hobbit'
This is extremely annoying, because of the performance penalty to launch a complete emulator.
But what is even more frustrating that I get back the very first version of MyFirstApp in this new emulator.
When I restart myself the emulator from scratch I see this in the console:
[2012-10-15 19:55:42 - MyFirstApp] New emulator found: emulator-5554
[2012-10-15 19:55:42 - MyFirstApp] Waiting for HOME ('android.process.acore') to be launched...
[2012-10-15 19:56:57 - MyFirstApp] emulator-5554 disconnected! Cancelling 'com.example.myfirstapp.MainActivity activity launch!'
Why? The emulator is still running at this point. This cannot be the normal way of working. Can anybody help me out?
Go to Run -> Run Configuration in eclipse. Select your application and update the target tab at right side to "Always prompt to pick device"
If the emulator is running and doesnt show in Devices then try to reset adb.
In eclipse: Device tab-> Dropbown - > reset abd

hello world fails to show up in emulator

I followed Hello World tutorial exactly. Emulator comes up but fails to show Hello World text. Here's the log info:
[2011-11-26 20:06:57 - HelloAndroid] Android Launch!
[2011-11-26 20:06:57 - HelloAndroid] adb is running normally.
[2011-11-26 20:06:57 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-11-26 20:06:57 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'AndroidPhone'
[2011-11-26 20:06:57 - HelloAndroid] Launching a new emulator with Virtual Device 'AndroidPhone'
[2011-11-26 20:07:09 - HelloAndroid] New emulator found: emulator-5554
[2011-11-26 20:07:09 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-11-26 20:45:37 - HelloAndroid] HOME is up on device 'emulator-5554'
[2011-11-26 20:45:37 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2011-11-26 20:45:38 - HelloAndroid] Installing HelloAndroid.apk...
After about 1/2 hour, this shows up in the log...
[2011-11-26 20:48:59 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2011-11-26 20:48:59 - HelloAndroid] (null)
[2011-11-26 20:49:02 - HelloAndroid] Launch canceled!
I’ve read posts on similar problem. I’ve tried many suggested solutions including restarting Eclipse, rebooting and restarting eclipse, creating a new project in eclipse, starting emulator first with “wipe user data” box checked, increasing the emulator time-out period from 5000 to 20000, unlocking emulator by clicking and dragging mouse, clicking Menu and Home buttons on emulator, and running the Layout version. Nothing worked. I’m using Android 4.0 AVD and Eclipse Build id: 20110916-0149 and the latest JDC on a Dell Inspiron 1501 laptop.
It’s hard to believe Google would make this discouraging example as the first impression new users experience. Hopefully someone can help.
When you have the "Failed to install HelloAndroid.apk on device 'emulator-5554!", try to wait some seconds,
dont close the VM and
reclick on "Launch Buton"
When you create a new Activity project, it effectively creates a Hello World app. Create a new project. Don't modify it. Just run it. If you don't see a Hello world message, check your install.

Failed to install HelloAndroid.apk on device 'emulator-5554!

Ive seen the questions posted about this issue. I understand it takes several minutes for the emulator to configure itself and launch. But if Im getting the specific error:
[2011-05-13 08:41:36 - HelloAndroid] ------------------------------
[2011-05-13 08:41:36 - HelloAndroid] Android Launch!
[2011-05-13 08:41:36 - HelloAndroid] adb is running normally.
[2011-05-13 08:41:36 - HelloAndroid] Performing com.santiapps.helloandroid.HelloAndroid activity launch
[2011-05-13 08:41:36 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'
[2011-05-13 08:41:36 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'
[2011-05-13 08:41:49 - Emulator] 2011-05-13 08:41:49.650 emulator[411:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2011-05-13 08:41:50 - Emulator] emulator: emulator window was out of view and was recentred
[2011-05-13 08:41:50 - Emulator]
[2011-05-13 08:41:50 - HelloAndroid] New emulator found: emulator-5554
[2011-05-13 08:41:50 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-05-13 08:44:33 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2011-05-13 08:44:33 - HelloAndroid] Device API version is 12 (Android 3.1)
[2011-05-13 08:44:33 - HelloAndroid] HOME is up on device 'emulator-5554'
[2011-05-13 08:44:33 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2011-05-13 08:44:34 - HelloAndroid] Installing HelloAndroid.apk...
[2011-05-13 08:47:20 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2011-05-13 08:47:20 - HelloAndroid] (null)
[2011-05-13 08:47:22 - HelloAndroid] Launch canceled!
[2011-05-13 08:53:55 - HelloAndroid] ------------------------------
[2011-05-13 08:53:55 - HelloAndroid] Android Launch!
[2011-05-13 08:53:55 - HelloAndroid] adb is running normally.
[2011-05-13 08:53:55 - HelloAndroid] Performing com.santiapps.helloandroid.HelloAndroid activity launch
[2011-05-13 08:53:55 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'
[2011-05-13 08:53:55 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'
[2011-05-13 08:54:06 - Emulator] 2011-05-13 08:54:06.327 emulator[460:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2011-05-13 08:54:06 - Emulator] emulator: emulator window was out of view and was recentred
[2011-05-13 08:54:06 - Emulator]
[2011-05-13 08:54:06 - HelloAndroid] New emulator found: emulator-5554
[2011-05-13 08:54:06 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-05-13 09:08:07 - Emulator] emulator: ERROR: unexpected qemud char. channel close
couldnt it be I have a bad configuration...?
wait for the emulator to setup completely and then test your app. Also, I would leave you AVD open so you dont have to wait so long everytime you run your application.
When it shows the red writing, don't close anything - leave it there and then press the run button again. Worked like a charm.
I was facing the same problem but i tried changing the ADB connection timeout. I think it defaults that to 5000ms and I changed mine to 10000ms to get rid of that problem. If you are in Eclipse, you can do this by going through Window -> Preferences and then it is in DDMS under Android.
Try this: create another emulator in AVD Manager and try to run your application in the new emulator.
Hope this might help you
You may need to increase the device ram size. For some Honeycomb AVDs at least, the default of 256 is insufficient, and caused me the same problem. Try at least 512.
Go to window and preference and increase the ADB connection time out(ms) which is 500 by default. Also change the base local debugger port to more than 9000 in my case it worked.
See Related post
This worked on Linux for me:
Run Emulator (Wait for the home screen of the Emulator to load)
Click Window > Open Perspective > DDMS
In Devices Panel, click on drop down menu > Reset adb
Run project
Valen answer is correct although its nice to know when to start running the app and when is not ok to start the app.Open the devices perspective. The next time you want to run an app first open the 'Android virtual device Manager' and run your avd then click on the device perspective and watch your emulator processes one by one firing up.. as soon this is done (its not fast you have to wait .. but at least you have some idea of whats going on .... a progress bar would be ideal for this place), click on your project and run as android app. On the devices perspective one more process will appear with the name of the package of your app. As soon as this happen your app is running on the device and it can be tested.
I have noticed this error when the emulator has not loaded fully, "android" is flashing on your screen. In other words, it is not yet ready for the application to be installed.
Just wait till you see that the emulator is fully ready, meaning the "android" has vanished and the device screen is visible on the emulator. Now run it and the application loads smoothly.
Restart ADB server from DMOZ
or refer to this tutorial How to solve Failed to install .apk

Cannot run Android apps with eclipse on OS X 10.6

Running Eclipse 3.5.2 (Classic) in OS X 10.6.7 with the ADT plugin. I have the SDK installed and have run the SDK and AVD Manager to install all available platforms and tools. I have an AVD setup with Android 2.2 as the target API, and have configured the example 'Hello, Android' app for Android 2.1 Update 1, so compatibility should not be an issue. When I Run the application, it starts up the emulator, but gives me an error before the android startup animation appears. Here is the output in the Console window of Eclipse:
[2011-04-10 06:45:40 - HelloAndroid] ------------------------------
[2011-04-10 06:45:40 - HelloAndroid] Android Launch!
[2011-04-10 06:45:40 - HelloAndroid] adb is running normally.
[2011-04-10 06:45:40 - HelloAndroid] Performing com.twopoint7.testing.HelloAndroid activity launch
[2011-04-10 06:45:40 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'testDroid'
[2011-04-10 06:45:40 - HelloAndroid] Launching a new emulator with Virtual Device 'testDroid'
[2011-04-10 06:46:04 - Emulator] 2011-04-10 06:46:04.613 emulator[997:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2011-04-10 06:46:04 - HelloAndroid] New emulator found: emulator-5554
[2011-04-10 06:46:04 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-04-10 06:47:22 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.twopoint7.testing.HelloAndroid activity launch'!
Any advice on what might be going wrong would be greatly appreciated. I've found lots of posts (here and on other forums) that seem to indicate the NSQuickDrawView vs. Quartz warning seems to be a problem across the board but doesn't have a solution yet. I'm more concerned with the "emulator-5554 disconnected..." bit and the fact that I can't seem to run any apps in the emulator. Any other info I can provide which would be helpful? Any insight?
Thanks in advance for your time!
I guess you need to reset your adb after launch the emulator. In eclipse, go to window -> show view -> other -> device(under android folder).
In the device view, find and reset adb. Then run your apps.

Categories

Resources