reasons for emulator not opening after installing android in eclipse - android

I installed android in eclipse, everything is fine but after launching the AVD, emulator was not opening. At what situations it will happen? It was showing error like
[2012-07-19 17:09:04 - DeviceMonitor] Adb connection Error:An existing connection was forcibly closed by the remote host

Check out this -
"The connection to adb is down, and a severe error has occured."
as well
Error: "Adb connection Error:An existing connection was forcibly closed by the remote host"
Or you can do one thing give correct path of android-sdk-windows.

I had some problems with the emulator button in eclipse, too.
Some times it just wont't fire the emulator up. I actually have no guess why this is (maybe it opens up in another dimension where you can't see it :P).
I worket around this issue by simply not using the button ;).
I start the emulator manually.
On linux after creating your emulator configurations you can start an emulator from the command line.
In your Android SDK folder there is a subfolder "tools".
You can run the "emulator" program and give it the name of the AVD configuration as first argument.
emulator #My_AVD_Configuration_Name
You have to put the # token in front of the name.
Then you can install your APK file by using the "adb" program.
The "adb" program is in the "platform-tools" subfolder in your Android SDK.
Just write.
adb install -r MyAndroidApp.apk
I hope this helps a bit :)

Related

android AVD connection refused on every other launch

Every other time I launch my app in an AVD I get this happy little error popping up:
Error running app:
Unable to open debugger port (localhost:8611): java.net.ConnectionException "Connection refused"
(would have posted a screenshot, but my reputation does not allow it)
It doesn't break anything, and after a couple relaunches it's back on track, but it's starting to annoy me. Does anyone know how to fix this? And I'm looking for a permanent fix, not a fix that would require me to do ten things over and over again every time this happens
Android Studio version 1.5.1 on Debian 8.2 using Oracle's java 1.8.0_66.
Also, to clarify, this is not an issue with my code. I can launch a completely empty project and still get this error popping up to say hi.
Running adb start-server in a standalone terminal yields the following:
cytodev#GE72-2QE:~$ adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
This uses a different port than the debugger port Android Studio uses, but I'm guessing that is normal.
There is an issue around IP v6 and how localhost is handled.
To fix the problem you will need to modify host file - see instruction.
(I don't deal much with Linux but I think it's similar configuration for both Windows and Linux)
Windows (Must open with administrator permission)
locate host file - C:\Windows\System32\Drivers\etc\hosts
uncomment (remove #) the following line:
# ::1 localhost
Linux (Must open with root)
locate host file - /etc/hosts
either add or uncomment ::1 localhost to the configuration file

I/O Error Connection refused android studio

WhenI run a project in android studio, I get this error - I/O Error: Connection refused
The emulator starts fine but doesn't pull in/reflect my project
Device connected: emulator-5554
Device is online: emulator-5554
Target device: Nexus4 [emulator-5554]
Uploading file
local path: /Users/martinsjolte/AndroidStudioProjects/FirstAPP1/Firstapp1/build/apk/Firstapp1-debug-unaligned.apk
remote path: /data/local/tmp/dk.first.Firstapp1
Installing dk.first.Firstapp1
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/dk.first.Firstapp1"
Device disconnected: emulator-5554
Launching application: dk.first.Firstapp1/dk.first.Firstapp1.MainActivity.
DEVICE SHELL COMMAND: am start -n "dk.first.Firstapp1/dk.first.Firstapp1.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
I/O Error: Connection refused
My platform is a mac osx ver.12.9.1
Ok, I don't know if i got "the" answer. but here is how I've solved the same issue on my environnement ( Windows 8/Android Studio, but same error with ADT or eclipse) :
Context of my issues :
I've got an Asus PC, and with all the application suite installed by default.
So I've found that one of this Asus app ( currently "Asus sync") was using adb and in fact, it was taking control of the emulator over my adb in the AndroidSDK directory.
How to fix as a PC user :
Go to Task manager ( right click on task bar) , and look for "adb.exe" . Then right click on it and select "Open the directory". This will bring you to the responding adb. In my case it was Asus Sync, so I just had to unistall this software and everything works fine !
How to fix as a Mac user :
Go to Activity Monitor (/Applications/Utilities/), and look for "adb". Then try to kill the process. Then look if it solve your "Connection refused" in Android studio/ADT or eclipse
If still not working you can try :
Start a emulator ( with your AVD manager)
when finished loading, Open DDMS panel (in android studio : Menu Tools > Android > Monitors DDMS)
Look if you see your current running android emulator ( listed on the Device panel)
See if this line is kind of "flashing" ( connect/disconnect).
If so, you have probably a other adb instance running in conflict
If not, you can restart adb or reinstall your SDK
Hope this could help someone !
This issue occurs when Android Debug Bridge aka ADB is not responding to the request from Android Studio. I killed the process adb.exe and started it again. This solved my problem.
If you are using a real device :
Just reconnect your device, make sure your cable are workable and you installed the proper drivers.
I had the same problem, and my problem fixed by restarting the android-studio. Hope, that will help you too.
For me the following worked(after I tried the above points mentioned by others):
I tried debugging/running anther application. It was okay. So this pointed me to the direction that the current application has some problem
if (point 1 == true) {I uninstalled the application from my phone manually }
Then re-make/rebuild the application and debug/run worked

Eclipse DDMS not showing Emulator on restart [duplicate]

This question already has answers here:
Adb won't start
(21 answers)
Eclipse error "ADB server didn't ACK, failed to start daemon"
(23 answers)
Closed 6 years ago.
I'm running Eclipse: Helios. Here's the issue. When I leave my Android Emulator running for about 20 minutes while I'm programming, if I try to install and run my application, I receive this error in the console:
[2011-07-12 12:27:55 - DatePrinter] Failed to install DatePrinter.apk
on device 'emulator-5554': Connection refused: connect
[2011-07-12 12:27:55 - DatePrinter] java.net.ConnectException:
Connection refused: connect
[2011-07-12 12:27:55 - DatePrinter] Launch canceled!
If I close the emulator and run the project again, a new emulator launches and the console shows the emulator starting but the app does not install and the emulator does not show up in DDMS.
If I go to the terminal and type in adb devices, I get this error message
ADB Server didn't ACK
*failed to start daemon*
error cannot connect to daemon
The only way I can fix it that I've found is to close eclipse, kill the adb.exe process and restart eclipse.
Any ideas what could be causing this error/how to debug it?
Edit: Starting the emulator through SDK manager does not yield any positive results either.
Edit 2: Running adb kill-server and adb start-server yields the same message "ADB Server didn't ACK" although it prints a "daemon not started, starting it now on port 5037" right before that.
Though I did not have the same problem as you did. In case of connectivity problems with emulator and Eclipse I use the following:
In the DEVICES window of Eclipse (DDMS perspective) drop down menu (in the upper right corner of the window) select "Reset ADB".
This solves most of connectivity problems, which otherwise will require restart.
Try this
adb kill-server
adb start-server
Check whether adb path has been added to environment variable, otherwise try to re-install the SDK itself.
I had the same problem. In the folder C:/../android-sdk/platform-tools, the following commands didn't work.
adb kill-server
Did nothing, and
adb start-server
resulted in an error.
So I killed the adb process with the task manager and used adb start-server again. And it works.
Here is a way to do it:
Open Task Manager
Select adb and end the process
Go to Eclipse and reset adb
Run your app
Check your Anti virus program control dialogs e.g Norton Antivirus and ZoneAlarm 2010.
Make sure that
eclipse.exe
emulator.exe
emulator-arm.exe
have input and outbound and network connections!

Adb server not responding [duplicate]

This question already has answers here:
Eclipse error "ADB server didn't ACK, failed to start daemon"
(23 answers)
Closed 4 years ago.
I am a Android newbie. I guess I might be doing something stupid here. I have started the Virtual Device and I see that adbd daemon is running from the Terminal Emulator. When I run adb devices I get the following error:
C:\Program Files\Android\android-sdk\tools>adb devices
* daemon not running. starting it now on port 5037 *
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
No other process is using port 5037. What am I doing wrong? Here are the packages I have installed -
1) Android SDK Tools, revision 10
2) Android SDK Platform-Tools, revision 3
3) SDK Platform Android 2.3.3, API 10, revision 1
This will occur normally,if abd is not able to launch properly and didn't exit when adb kill-server is executed.
So if in Windows
1. Go to Task Manager (CTRL+ALT+DEL)
2.look for adb.exe and end the process.
Now restart the emulator ,should work properly.
additionally you can close and launch the development environment also (eg: Eclipse or NetBeans).
I suspect the problem is cause of many adb instances (in windows) , i usually face this problem cause i don't turn off my system so the adb process may not end properly.
So open task manager choose Process tab just search for adb.exe, right click on it and choose End Process Tree rather than just End Process
Had the same problem, it seems that my security solution was blocking adb.exe
this is not the right folder for adb : lately adb has moved from /tools to /platform-tools in the sdk folder.
Seems like the security program is blocking adb.exe, so go to the adb file path and open adb's properties, then check the Run this program as administrator setting.
In my case the process adb.exe starts when i connect the phone, and then when I adb devices then I have your problem, and killing the process does not help it is resurrecting like a stubborn zombie, as long as the phone is connected.
so my solution was to disconnect the phone, then kill adb.exe process, then start it by adb devices and connect the phone
After that when i command adb devices i ma getting the same prompt about killing adb out of date, but this time on the second line is * daemon started sucessfully*
win xp
htc sensation
the new eclipse adt sdk bundle from google so i suppose up to date.
I found there was a process call "Tadb.exe" in Windows Task Manager.
I guess Tadb.exe is a similiar adb application of Tencent. Because I got an alert of "android device detected by QQ" after I install the last version of Tencent QQ2013 Beta5 (6970) yesterday.
After I killed the Tadb.exe, the original adb.exe of Android SDK works again.
You can see the detailed proecss to solve this problem here:
adb cannot run, adb server is out of date
I turned off the Windows Firewall and its working like magic. I am connected to the Internet through WiFi. If you are not behind a proxy and are still unable to access the Internet through a wireless link via the emulator, go to Device Manager and disable your LAN card.
As I have tried as follow by combining omni.present's method , and finally emulator works fine.
firstly I stop adb.exe process in the task manager
then I stop and start eclipse
The fundamental reason is because the 5037 port on your machine to be occupied by a process, not only Android devices can not use adb connection ios device not use iTunes.
Can query process and close it, netstat / a / o maybe can help you to take up to 5037 ports.
To windows7 the LogsAndAlerts service will occupy port 5037.

Android Emulator won't run application started from eclipse

I have followed the "Hello World" example from Google's Android developer's guide. When I try to run the application in the SDK emulator, nothing happens. The emulator startd up nicely, but after that nothing happens. I can't even see the application in the app tray.
I am using Eclipse with the Android add-on installed.
Had the same problem, the console log stalled after:
Launching a new emulator with Virtual Device
and the emulator never showed the HelloAndroid application. I finally figured it out!
In Eclipse go to
Run --> Run Configurations
Then change the Launch Action for your application (e.g. HelloAndroid) from "Launch Default Activity" to "Launch:" and then select your application from the pull-down menu. This did the trick for me.
HTH,
Sven
Same here; emulator loads fine but apk doesn't get installed. Problem is only with the emulator. All works fine if physically connecting a device with USB debugging turned on.
NB This suddenly started happening for no apparent reason. All used to work fine.
I've tried uninstalling and reinstalling the ADT Plugin and I've updated the Android SDK and AVD Manager to the latest available. (Tools revision 7) but the problem continues.
Eclipse: Helios Service Release 1
Build id: 20100917-0705
Running on Windows XP SP2
Just as others have posted, the console log shows
[2010-10-14 11:39:33 - uad-MediaPlayerExample] ------------------------------
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Android Launch!
[2010-10-14 11:39:33 - uad-MediaPlayerExample] adb is running normally.
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Performing com.msi.manning.chapter10.MediaPlayerExample.MediaPlayerActvity activity launch
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Automatic Target Mode: launching new emulator with compatible AVD '1.6-hvga'
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Launching a new emulator with Virtual Device '1.6-hvga'
LogCat remains empty/blank.
And if I then try to re-run the same app, the console shows:
[2010-10-14 11:39:33 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting
POSSIBLE ANSWER???
One solution seems to be to kill the adb.exe process in Windows Task Manager (while the emulator is still running).
(from http://vikashazrati.wordpress.com/2008/01/01/quicktip-android-does-not-load-my-application-in-the-emulator/)
The console suddenly shows lots of errors:
[2010-10-14 12:12:00 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:01 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:01 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:02 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:02 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:03 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:03 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:04 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:04 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:05 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:06 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:06 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
but the app starts in the emulator. !!!
(as expected the LogCat also suddenly starts to display lots of messages)
All works fine - i.e. you can work on your code and re-run the app in the same emulator and it reinstalls as expected...
BUT if you close the emulator, you see the following console error:
[2010-10-14 12:15:05 - DeviceMonitor]Sending jdwp tracking request failed!
And the same problem reoccurs - a new emulator appears but the apk isn't installed. So you need to go back to Windows Task Manager and once again kill the adb.exe process.
NB I find that adb.exe doesn't reappear in the Task Manager unless I restart Eclipse, so after closing an emulator you have to restart Eclipse, try Run (which fails to display the app) then go back to the Task Manager where adb.exe is once again listed and kill the process for the app to start.
Would be great if someone could provide an explanation for this and a permanent fix...
I have the similar problem. I suggest the following workaround:
close eclipse, in the Task Manager, kill all adb and emulator* processes.
start eclipse, run your application, wait untill the emulator starts. If you have the problem, your application won't be started, there will be the bare emulator.
In eclipse, select Window->Open Perspective->Other->DDMS. Switch to DDMS perspective. If you have the problem, the list of the devices will be empty.
In the Devices tab, in the drop-down box, select "reset adb". In a short while, the emulator must appear in the devices list.
Following that, switch back to your Java perspective and run your app. Everything must work fine for the rest of the session.
Actually, if you are using Windows, the problem might be that the User Account Control in your Windows is preventing Eclipse to load the apk in the emulator (Eclipse doesn't have right to do so).
To turn off the User Account Control, go to the Control Panel, click User Accounts and Family Safety, and then click User Accounts. Once there, click the option 'Turn User Account Control on or off'.
Depending on your computer it can takes several minutes to load the emulator and the app. Open Logcat view to see the progress of loading.
Same problem. Killing adb from task manager didn't help. Also tried restarting the AVD using android create avd --target 2 --name my_avd --force, no good. Tried the different launch method in Eclipse, nada.
What eventually helped is: I started (from the start menu, not command line) the Android SDK Tools > SDK Manager, found the my_avd under virtual devices, and simply clicked the Start... button. That did it - the emulator started, I ran from Eclipse, and it immediately showed the app on the emulator.
One solution is go to android sdk/tools directory and start ddms.bat for Dalvik Debug Monitor, then select Actions->Reset adb. That seem to fix the problem
In my case the problem occurs because of the simple thing: i do not select the project that i want to run. Click on it in solution folder, then press run and enjoy. Hope it will help someone.
The Android emulator takes approximately 1 to 2 mins to load. Check the console tab in the eclipse IDE for evaluating the progress of loading the emulator and installing the application in the emulator.
I used to face this problem a lot. There is workaround for this,
End the "adb.exe" process from the Task Manager and try again.
It should work.
and instead of running from eclipse i use following batch files in my project directory to install and uninstall the apk. Those work great.
Install.bat
cd bin
adb install *.apk
Uninstall.bat
adb uninstall this.is.package.name
STEPS TO FOLLOW:
Go to Command Prompt
type adb kill-server
enter
Now it should work fine
For me the solution was to choose "app" instead of "RSSReader" (my project name) in the dropdown next to the AVD tray. When I choose "RSSReader", the AVD is greyed out and unusable.
This leads me to wonder if my project is setup wrong or if "app" is the correct state.

Categories

Resources