I'm using Windows 7 Ultimate 64 bit edition and Eclipse 3.5 with the Android plugin. Every time I create a new project and try to publish it, I get an error like this:
[2010-02-15 22:48:10 - EPG3]Uploading EPG3.apk onto device 'emulator-5554'
[2010-02-15 22:48:15 - EPG3]Failed to upload EPG3.apk on device 'emulator-5554'
[2010-02-15 22:48:15 - EPG3]java.io.IOException: Unable to upload file: timeout
[2010-02-15 22:48:15 - EPG3]Launch canceled!
The emulator is working perfectly, adb can see it, I can even logcat from it, but it can't push or pull anything from it. Nothing appears in logcat to suggest the emulator even received any command. It doesn't matter if I have the Firewall on or off, or if I try invoking adb install to bypass the plugin. Nothing works even with a blank app.
Any ideas?
Not sure if this helps but I had the same exception when I tried uploading a project to the device and fixed it by increasing the value of "adb connection time out (ms)"
PC: (eclipse -> window -> settings -> android -> ddms)
MAC: (eclipse -> preferences -> android -> ddms)
I was pretty pissed at myself that it took me so long to find the setting so I thought I'd share.
I just ran into this error. To resolve it, I deleted my .apk file and built the project again. Voila! Upload works now.
Isnt this a problem with resources loading? Tried all the hello examples without problems, now the first with drawables and now I/O problem as you had.
I think its the reason that in the example they speak of a drawable folder, but in my default project structur there are 3 drawable folders.
Keep on debugging ;)
I got this error about every 30-40 compilations. I don't how, but this solution work for me.
Go to bin/ folder and rename your EPG3-debug.apk file to EPG3.apk (if you are using debug mode) or EPG3-release.apk to EPG3.apk (in Run mode), return to Eclipse, now you can Debug/Run your application. This should "unchoke" this whole situation, so you can make changes in your code and next time Debug/Run program normally (until you get this error once again, then you must repeat this tip).
See this question — Windows 7 and Android don't seem to get on so well initially it seems: Failed to parse the output of 'adb version'?
Are you able to telnet to localhost 5037? That's where the adb server listens for incoming connections from adb clients.
Did you try to add the path of the tools directory to your system PATH as described here ?
Related
I am trying to start development on an Android app using Android Studio, but whenever I try to run the app I get the error Unable to obtain result of 'adb version' I have tried uninstalling and reinstalling Android Studio multiple times on different computers (both running Windows 10) and every time I get the same error. I have researched the problem and have been unable to find a consistent solution. (or one that actually works) I am very new to Android development and am slightly at a loss as to what to do; any help on solving this problem would be much appreciated.
Found the solution thanks to #user3109468, Android Studio had the directory for the Android SDK wrong. In File>Project Structure make sure the directory for the SDK is correct; mine was C:\Users\[user]\AppData\Local\Android\sdk (Google had given sdk a capital "S" for some reason...)
Uncheck: enable adb integration from Tools>Android and re-enable it.
This worked for me.
This might be because of windows virtual memory problem.
Try running adb from command line. something like
adb version BTW, platform-tools would be located in
c:\Users\<your userid>\AppData\Local\Android\sdk\platform-tools
How much it takes from you firing a command and actually gets an answer ?
if it takes more than 5 seconds, then android studio times out waiting for an answer and throws up an error.
How to fix ?
close all your program ( Process ? )
and go to control panel -> System->advance System settings-> Advanced tab->performance->settings->Advance->Virtual memory change
Try to reduce virtual memory size. Fr e.g. If it's 4096Mb make it 2048Mb ( both initial and maximum) It will ask to restart, so restart and get yourself a cup of coffee, because it will take a while. Then, once your system is up , try running adb version. Does it run quickly ? If yes, problem is fixed. Go back to virtual memory and increase it's size to the one before, and that's it.
BTW, I noticed in my case that simple hello world program was taking 20 sec to execute on my machine before fixing virtual memory problem.
Make sure Android SDK location and Android NDK location is correct.
Go to File -> Project Structure.
Set the Android SDK location and Android NDK location.
I am having a problem in running my app in Emulator. There are no errors or warnings in the code, its running perfect in device, but when it comes to emulator, it always crashes and the error message would be like this
[2012-01-16 16:13:55 - MyApp] Failed to install MyApp.apk on device 'emulator-5554!
[2012-01-16 16:13:55 - MyApp] (null)
[2012-01-16 16:13:55 - MyApp] Launch canceled!
I have tried the following things:
Run configurations > Target > Wipe user data > Run
Uninstalling the app and run it again
Restarting the emulator
adb kill-server && adb start-server
Creating a new Emulator and running the app in it
Restarting ADB
Restarting Eclipse
Starting the Eclipse after the emulator is launched completely
Increasing the ADB connection time-out to 1000
Restarting the System
Deleted the emulators and created new emulators and run in it after they are completely loaded
I don't know what else should I do. Sometimes if I run in a new Emulator the app runs for the first time and if I run it again after sometime, its the same crash report. I am not able to understand what is the problem.
Can anyone please suggest me what should I do now and where is the problem?
The Emulator used to work well before. This problem started a few days back.
Any help will be appreciated. Thanks All.
Have you defined all of your Activities correctly and completely in AndroidManifest.xml?
Can you paste the definition of your AndroidManifest.xml here?
Try that.
More possibilities:
Real refresh of AVD. It is funny, but Eclipse remembers your emulator. And if you turn it off and on it will be the same old good (or bad) one. You could reinstall all Eclipse for a real refresh. Or use a shorter, but tricky way. Change the max VM app heap size of the emulator. (Android SDK and AVD manager - Virtual device - Edit) Create it. Now you have a brand new emulator. Funny, isn't it? Now you can change the heap size back, if you wish.
Really, I think, you can maybe change any emulator parameter for the effect. Only I stumbled upon it by heap size and stuck to do it this way.
Try to repair the path.
Set the path environment variable with the path of "platform-tools" and "tools" found in the "sdk-home".
On windows(vista):- 1.Go to "Control Panel\System". 2.Select "Advanced System Settings". 3.Select the "Environment variable". 4.Set the path environment variable under the system variable with values "SDKHOME\platform-tools;SDKHOME\tools". Where "SDKHOME" is the home folder of Android sdk.
Check,if APK version of the application sits with that of the
emulator.
Try to set a longer waiting time for launch.
Increase AVD heap and SD card
Maybe, it would be good to try to recall all the changes that were done before the problem appeared?
Oh! One more: Don't you have by accident simultaneously launched emulator and connected device? If you have the same application (ssame name) on both, they could conflict in a similar way! They simply won't let each other to be launched
If nothing helps:
I was already so tired of Eclipse errors, that I have installed the IntelliJ Idea IDE, too. Now, if for the same project applications behave idself differently on both IDES, the problem is in IDE setting or emulator. If the problem is the same on both, I look for a bug in my application or the external device. Once I had a problem in OS - had to restart Linux. But in your case it is the most probable, that the problem is in AVD. I am afraid, the only variant you haven't try yet is to reinstall Eclipse. Uninstall, remove everything from the application except code, layouts and Manifest, and install Eclipse anew. Or make other Eclipse installation, with its own workshop. You can try the last version. But if the problem is in some setting, you can set it again...
Sorry, I have put here all methods I used or found.
here you can find a similar problem and the proposed accepted solution:
Honeycomb preview - can not install my app on emulator under Eclipse
I hope this helps.
This could be due to Antivirus/Firewall software installed on your PC. Have you tried to disable it?
You should also ensure that versions of Eclipse, ADT and Android SDK are up-to-date and compatible. Have you tried to contact update sites in Eclipse and in Android SDK manager? By the way, what versions of the that software do you use?
Let's go step by step.....
1º- You should try to start the emulator without the application installed.
2º- Once it is running correctly, try to install another .apk(like for example one default one....)
3º- Now, try to run the .apk. If the problem continues, try to delete the current VM and install another new one.
Can you see Emulator in "adb devices"? If yes, can you install any .apk?
If not - you have propablly something wrong with sdk
As some people have answered already partly. Make sure of a couple things which are very important specially because of the latest Android tools releases which requires.
The latest eclipse version. Yes, very very important:
http://www.eclipse.org/downloads/packages/eclipse-classic-371/indigosr1
Make sure you update the Android ADT plugin for eclipse:
http://developer.android.com/sdk/eclipse-adt.html#installing
I've encountered similar issue and that was what has helped. Restart your computer too possible?...
Use command prompt to start emulator
emulator.exe -avd google2.2 -scale 0.7 -dns-server 8.8.8.8
it may help you.
try cleaning your project or deleting the .APK file in the bin directory of your project.
The Console and LogCat printouts stopped working in Eclipse with the Android Emulator.
I'm getting the following Exception in the Console
[2011-11-10 11:04:58 - Unexpected error while launching logcat. Try reselecting the device.]device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:319)
at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:100)
at java.lang.Thread.run(Unknown Source)
Usually when the emulator is loading or updating an apk there's a printout in the Console telling the status. Now the Console is just blank.
I made sure the emulator is selected in the DDMS Tab.
I tried deleting and recreating the emulator in the AVD Manager. I restarted eclipse and the computer. I also updated all of the android and eclipse software in hope that the problem may get fixed. But, to no avail.
It may be related to a problem I had in my code yesterday. There was an unending loop in my code, so I had to stop the emulator mid code running.
I was having a similar error and it was driving me crazy. I just got it to work by doing the following steps:
In a shell or command prompt run: adb kill-server
Unplug the USB cable from the device and plug it back in.
Open the devices view (Window -> Show View -> Other -> Android -> Devices)
Click on the device on the android devices view.
I tested this for the emulator and it works if you relaunch the emulator instead of step 2.
Another way I got it to work was to restart Eclipse. But that's not usually ideal.
Note: Logcat would stop working any time I disconnected the usb cable from my android device (similar to killing an emulator).
I recognize this might not fix your initial issue, but it might help others who stumble on this question.
I also had the same problem, install the SDK even three times as TT, but the solution is to go to the folder android-sdk-windows, then platform-tools, and double click adb and ready!
Clean project with Project/Clean...
deleting the emulator and creating a new one did the job for me.
Even in my case a faulty code or a secret infinite loop, i think is the problem. i tried out something and logcat failed to boot up since then.
Most likely you have 2 instances of Eclipse running (I did).
(On Windows) Exit eclipse then check with the Task Manager if there is another eclipse.
End it as well as any image name "adb".
The project I tried to run is set to minSDK level 7. I have gotten the above error message when running Android virtual device-5554(the other devices work well). It is working so slowly, and taking too much time to get home screen not even run. At the end, it gives this error :
Failed to install *.apk on device 'emulator-5554': EOF
I restarted my computer and Eclipse several times, as well as clean projects. I also tried this Why is the Android emulator so slow? How can we speed up the Android emulator? to get it fixed. Yesterday, it was working pretty well. Now it is so sluggish.
Any suggestion or help? Thank you
I've ran into this problem many times. Try each of these steps after each step run the APK file if it doesn't work move to the next step:
Run it again. (simply try rerunning it).
Project->Clean (clean the project plus any projects that it relies on).
Right click project in the package explorer then close it. Then close Eclipse. Then reopen both.
Same as the previous step plus Project->Clean.
Restart the AVD.
Delete the AVD. Then go into the folder that holds the AVD in the Android-Sdk folder and delete anything with the AVD's name (a file plus a folder). You may have to restart your computer to get it to delete. Create a new AVD.
Run the next command:
adb kill-server
adb start-server
Is possible that drawn the next messages
DeviceMonitor]Connection attempts: 1
DeviceMonitor]Connection attempts:2
Solution:
Start emulator (separately) and wait until it is fully loaded.
Open keylock.
Navigate to Eclipse and run your app.
Cause of the problem: Android emulator hasn't loaded all its libraries which handle the installing of a new application and due to that you run into java.io.IOException: EOF
That was causing me the problem.
you could try this:
1. Open the "Android Virtual device Manager"
2. Select from one the listed devices there and run it.
3. Right click your Android App -> Run As -> Android Application
It worked for me. I tried this on an emulator in eclipse.
It takes a while before the app is run. For me it took 33 seconds.
Wait until the message in the console says "Success!"
When it shows the red writing - the error , don't close the emulator - leave it as is and run the application again.
As per my knowledge there are two ways to solve the problem..
Delete the .apk which regenerate again after the compilation, and test the emulator again.
Delete the emulator and create new emulator besides your app.
I think it work...if not then please check your logCat,which show you the actual error & try to solve it....
I hope it helps to you.........
I was getting this problem because of Encoding problems. To fix, you can (using eclipse 3.6. STS)
Right click on the Project, select properties, choose "Resource" (first option on my properties screen)
Under "Text file encoding" choose Other->UTF-8
Click the "Apply" Button and continue with Ok.
Project->Clean
Project->Run
.apk loads fine.
Try window->show view->devices->view menu->Reset adb and again run application.
the solution is you have to change the time out value to at least 15000ms(milliseconds)as milli is less than seconds, it will be in an instance.. no need of restarting. We should give some time for emulator to upload files for complete run. It depends on our system configurations.
Go to windows->perspectives->android->DDMS->timeout to 15000.
this will work...change the time if it is not working.increase the heap size and try to manipulate the Api minimum level.
In my opinion you should delete this AVD and create new one for API-7. It will work fine if not please let me know I'll send you some more solution.
Regards,
Uninstall the apk from the Emulator.
Try to run the appliaction again from Eclipse.
Please check the version for the Minimum Android SDK version & try to
run it on the Emulator created AVD Manager.
It will Work Definitely...
just close the eclipse and avd emulator and restart it. It works fine
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.
Neither above helped me, instead, I connected my phone through the back USB hubs (I used forward USB hubs previously), and this helped me!
In my case I have used a tab size(7") emulator to test the application.But It gave me
"Failed to install xxxxx.apk on device 'emulator-5554! " and launch cancelled.
The only worked solution to me was set the emulator ram size bit high(1512Mb) and VM Heap size to 36.
After that It worked like charm.
Thank You.
adb is very crazy, after several attempts I found out I was with many devices (emulators and devices) connected , so I removed all devices and it back to work again
don't start android emulator
Right Click on Project>Run As>Android Application
and then android emulator automatically start
now ok
I solved The problem by restart Eclipse then Project -> build all
Wipe Data and restart the virtual device again fix the issue in my case.
In my case I was getting these errors during installation of an apk on a device:
Error during Sync: An existing connection was forcibly closed by the remote host
Error during Sync: EOF
Unable to open connection to: localhost/127.0.0.1:5037, due to: java.net.ConnectException: Connection refused: connect
That led to:
java.io.IOException: EOF
Error while Installing APK
Restarting a device and adb devices didn't help.
I replaced a data-cable and installed the apk.
When it happened to me, I solved it by closing the emulator and running the project again.
I'm a noob learning Eclipse and Android. Whenever I close the emulator I get "DeviceMonitor]Sending jdwp tracking request failed!" in the Console tab. Infact that seems to be the ONLY thing I get in the console tab - I don't get all the emulator loading messages and other things I used to see.
Everything else seems to work, I can build, run in the emulator, debug in the emulator (via Run>Debug after setting a Debug configuration . . . I can't get "Debug As" to work, see: "Debug As..." in Eclipse for Android - don't know if that's relevant to this problem).
What does this message mean, and how do I correct it? Thanks in advance!
The message you receive is in the normal console of Eclipse and isn't really important, because it just reports you that the connection to the emulator was lost. That ok as you described you closed it.
The normal android log is only visible via the adb tool (via console) or with the view in Eclipse called LogCat. You can add that to your working screen if you go to Window -> View -> Other -> Android -> LogCat
I recommend to look at the other views of the android tools, too. Like Device or Explorer.
What might happen with the LogCat output is that it went blank. Than you need to clear the LogCat (there is a button for that on the top of the view) and if this doesn't help try to click on the emulator in the device list. If nothing of that helped: close eclipse and the emulator and start them again.
I fixed by changing the usb cable which was connected to PC and device.
Before that restarting dev machine, eclipse, even the device dint help.
Close eclipse, stop adb process. From command line, "adb kill-server".
Launch your eclipse project.
I don't know if this will help for sure, but I had a similar problem and I solved it by changing my workspace to a different folder where I placed copies of the projects and changed the names of the folders just one caracter so that It would not tell me they are already in use. Then I worked I just had to import the projects again and I refactored their names to match the code (just the project names).
This error is mostly result of incorrect permissions set for "ddms"/ "android" scrips residing in "your sdk location"/tools.
If you are getting only
Sending tracking request failed!
error then change the permissions assigned to tools/android.
To do that open the directory "your sdk location"/tools/ using file browser. You should see a file named android, right click-> properties -> permissions tab -> select allow executing and program. [chmod].
If your error is
Sending jdwp tracking request failed!
then you need to apply same procedure described above for "your sdk location/tools/ddms"