After
increasing the timeout period
trying kill server and start server commands
restarting avd
recreating avd
restarting the application
restarting the system
I'm still getting :
Failed to install DataAttach.apk on device 'emulator-5554': device not found
com.android.ddmlib.InstallException: device not found
Launch canceled!
What can be done in this case?
I'm running this app on Emulator (Android version 4.0)
Edit
Apps doesn't have any issues as far as code is concerned. Still they are showing error about device not found exception.
I was also getting the same error, but to my surprise the application was installed correctly and I could launch the application. I am sending this reply just to let you know guys if you want to check and see if your application was actually installed along with this error.
Using Project->clean option before run solved the problem for me.
This has to be sorted out by manually installing the apk through adb command prompt.
After navigating to tools folder from comand prompt,use
adb install DataAttach.apk
(where DataAttach refers to package name, as in my case package name is DataAttach.apk)
I have gone through the all the trick mentioned here. But it was not successfull.
After that I restarted my device and everything started working. I dont know the exact error but this trick helped me to resolve the issue.
If you're using a real device (not emulator) then try uninstalling the existing .apk from the device then re-run. This solved the error message for me.
Cleaning my project helped me to solve this problem.
Project->Clean->Run
Related
I have this strange error when installing apk on device, from Eclipse. The console gives error message: Failed to install, but in fact the file is installed.
Also, the application doesn't start after the installation, I have to do it manually.
I have done the this same procedure over and over again, without problems, but now the error occurs.
Thanks!
I've found that sometimes a device gets stuck in a strange state, and no matter what you do will give odd errors on install. Turning the device itself on and off again usually cures the problem.
Does your ADB work normally when issued from command prompt? Try installing any apk manually using
adb install <filename.apk>
and see what is being returned. It may be an issue with the return from adb not being correctly recognized by eclipse. I'll also suggest changing the USB port to check if the same issue is occurring.
Try to remove the app on the device before installing the new apk...
I'm trying to import android applications from other computers. after sometime they're running on emulator finally now but not on the device .
probably the reason is the driver I installed , because adb devices did not recognize the device so I installed this manually and still Bluetooth Peripheral Device not installed when I check in device manager!
at first it gave me this error : the app stopped running unexpectedly !
now the error is :
Re-installation failed due to different application signatures.
You must perform a full uninstall of the application. WARNING: This will remove the application data!
Please execute 'adb uninstall com.newboston.aida.android2' in a shell.
Launch canceled!
any idea how to solve this?
I just typed adb uninstall and then the name of the package in command prompt and it works !
Uninstall the application from android device or emulator, and try to re-run / install the application. Because debug.keystrore is different for every devices.
Try to create a new virtual device. Maybe it'll work when you install the driver first. It's possible, that your phone will be recognized then. And I don't think win7 is the problem.
If possible can you just Change the Package name of the current working project. And try to Build it. it might get other path and would run. This is a kind of Patch i know, but just try it out....
I get the same problem while moving the application from one system to another... some time the problem comes due libraries path and the api level.
So you can check the api level is the same in the application buildpath in the other system.
Hope this will help you.
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.