what jichao said always works for me.
generally when i see this error if i am using eclipse i will close and reopen the program. i will then uninstall the application from the target phone. this sometimes fixes the issue but not always.
next i will open up the command terminal and head into the android-sdk then run:
./adb install <appname>.apk
this does the same thing that running through eclipse does but it will give you an error message.
(9 times out of 10 it simply says 'install_already_exists' and i go and uninstall the application off the target phone again then run adb and i am working fine.)
i was getting the same error.
i just left the avd running even after it says
"failed to install *.apk on device-emulator-5554". it automatically loaded the project afterwards.
i think the error comes due the slow start up of the avd.
i was getting the same errors with my devices.
first be sure that you do not upload debug apk to a device having already installed the same apk but signed with release cert. in this case you've got to uninstall it first from the device.
in other cases my solution is to reboot everything:
- reboot device
- pskill emulator-arm.exe
- pskill eclipse.exe
- pskill adb.exe
after that the device, adb and eclipse are working.
when it shows the red writing - the error , don't close the emulator - leave it as is and run the application again.
restart the adt or try 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.
ok, this approach will only be useful when you are connecting to a real device rather than to an android emulator.
resetting the ddms adb connection timeout won't work nicely with a real device when there is a problem with usb debugging mode of the device.
so, disabling and re-enabling usb debugging mode seems to resolve the issue by creating a new fresh adb session on the device.
go setting- security verify apps if checked, change to unchecked status, then change to checked status
1) remove the apk from this directory project/build/outputs/apk
2) if you using genymotion emulator restart the genymotion
3) make project & rebuild the project
4) run again
as for me, i had the same problem and it helped to increase sd volume and max vm app heap size. (android sdk and avd manager - virtual device - edit) what is interesting, the back change of sd and heap to the previous values is ok, too. that means, that any change of emulator parameters and its rebuilding is enough. (simple restart won't help)
i had imported an existing project and started running... i too was facing the same problem (warning: application does not specify an api device api version is 11 (android 3.0) ). after all my attempts to resolve that failed,i just created new project under other package to maintain the same names and copied all the file contents of the previously imporetd projects manually and again started running...to my surprise it successfully executed in my first attempt...i think the problem was due to the lack of compatibilty of versions when imported...i hope it may help few...
i was facing this problem time and again.got around a lot of forums, but couldn't find a logical solution for the issue.
i used to get this error message, . . . uploading test.apk onto device 'emulator-5554' failed to install test.apk on device 'emulator-5554': timeout launch canceled!
this error is thrown as the start of emulator and deployment of application takes some significant time and before that the emulator times out.
a simple fix for this problem is keeping the emulator open when this problem occurs, *just run the application again. this only deploys the application on to the already started emulator *. there is not much time consumed during this run as the major part of the time during app deployment is because of slow start up of emulator.
hope this helps!
just try the following steps,
- go to home screen before you start to run the application.
no need to uninstall every time. just uninstall your application once properly.
go to setting -> manage application -> click menu -> filter -> third party application. check whether your application is there or not.
- after modifying your application just save it. right click your project and select "run as android application".
- note: once again, before running your application check whether or not your emulator is showing the home screen.
going to home screen: from eclipse go to menus: window->android virtual device->start
@bolton 's answer worked for me. some details...
i got my phone a few weeks ago. i tried the helloandroid sample app right away (after installing req'd software, etc.). the app worked in the emulator and on the phone--right away!
shortly after that, i rooted my phone but did not flash any roms or kernels. i was only experimenting on the emulator until yesterday (writing a simple notepad app). when i tried debugging the app on the phone, here's what i observed:
eclipse console reported the "...failed to install on device...(null)" message. but
the helloandroid app did get pushed to the phone! (it appeared in the apps drawer and i was able to launch it.)
it simply would not launch on the phone from the eclipse run.
i searched around here and elsewhere last night (including this thread) with no luck. finally, i rebooted my phone--which i never tried (doh!) 'cause i didn't think it would make a difference--and the app launched from an eclipse start!
still don't know the cause, but i'll come back here if i figure it out.
i have the same problem: failed to install test.apk on device 'xxxxxxxxx': null
i try to reboot phone, restart eclipse, and nothing!
then, i remove this project from eclipse workspace, and import again. (file, import, existing project to workspace). i do not know exactly what the problem was, but now is working ok.
i ran into the same problem and tried increasing the adb connection timeout... didn't work.
i tried putting the "android-sdk/tools" and "android-sdk/platform-tools" in the path variable.... no effect.
i tried restarting eclipse and letting the avd startup before running. same problem.
i can sometimes get it to work with a combination of closing and reopening the project, followed by cleaning and rebuilding the project. it doesn't always work, but since i didn't restart the avd this last time, i think the problem lies within eclipse itself. you might try deleting everything in the "bin" directory of your project and then cleaning and rebuilding. it might be some temporary or intermediate files not getting deleted properly. another thing i had to do was delete my avd. it didn't delete properly, and i had to go in and manually delete the avd's subfolder and then re-create the avd. some combination of these clears the problem up temporarily. hope that helps.
if unplugging the device and plugging it back in doesn't work, try increasing the upload timeout to something really huge like 20000 ms. it's at window → preferences → android → ddms → "adb connection time out (ms)".
i had the same problem and solved it by adding the paths of android sdk folder tools and platform-tools to system path variable then restarting the device.
if you are running it on an android emulator you do not want to close it between runs. the system will try to load the app and it will time out because of how long it takes the emulator to boot up. you can fix this by increasing the adb time by going to window -> preferences -> android -> ddms and increasing the adb time out (default is 5000ms) or by leaving the emulator open and just running it after the emulator is up and running.
i personally would recommend leaving the emulator open as it does load the apps relatively quickly once it is running, but it could be a drain on the system. do whichever would help you more.
something else you might want to consider is a hard reset of your emulator by wiping your user data.
in order to do this you: - right click your project name in package explorer - go to 'run as' then 'run configuration' - in the 'run configuration' window click the 'target' tab - then tick the name of your chosen emulator - tick 'wipe user data', click apply
and the next time you start up your emulator it should prompt you asking whether you really want to wipe your data. click yes, and hopefully it helps you to install the app.
i get this from time to time, but it's usually related to the emulator being slow to start. try again without closing the emulator between the retries. and if it still fails, please post the client logs (logcat).
another reason can be a ghost eclipse process running in background and still bound to the debugging port. close eclipse, look at process list and see if there's still an eclipse running. kill all of them and restart eclipse again.
restarting the device works for me. using adb install can get the apk installed, but it's annoying to use it everytime you launch the app when debugging within eclipse.
try 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.
as described here: android error: failed to install *.apk on device *: timeout
- Android Emulator Fails To Launch :: Failed to install apk on device 'emulator-5554': null
- Android Failed to install HelloWorld.apk on device (null) Error
- Android - Failed to install apk on physical device but successful on emulator
- Failed to install apk on device 'emulator-5554': timeout
- Cannot install APK on Android device through Eclipse
- An android virtual device that failed to load. click 'details' to see the error
- In game Images disappear on Android device if i run from widget, but not when I install apk first time
- Failed to install apk on real device
- Failed to install apk on device 'emulator-5554': No such file or directory
- Failed to install apk on device
- New Eclipse & Android Install - Conversion to Dalvik format failed with error 1
- Installed android app with eclipse working but install app with apk failed when launch?
- Android Error - Open Failed ENOENT
- Failed to install Android ADT
- Error "AdbCommandRejectedException: device not found" in Eclipse using Android emulator
- Android logcat error: ZipFileCache: init failed when open zip file - device specific?
- Failed to install *.apk on device '*': Local path doesn't exist
- An Android Virtual Device that failed to load
- Android APK file and DEX files not created, with no warning or error
- Phonegap error android sdk build.xml:950 : null returned: 1
- Android - Failed to find an AVD compatible with target 'Android 1.6' error
- Eclipse Stalling on Android apk Install
- Failed to detect New Relic instrumentation. error in android application
- Android APK not installed in the device
- Getting "Launch error: Failed to connect to remote VM. Connection timed out" when trying to debug my app on my device in android
- Eclipse IDE: Failed to initialize monitor thread error after installing Android SDK?
- Installation failed due to invalid APK file! - Android
- How to disable error like Eclipse while creating signed apk in Android Studio 1
- android virtual device that failed to load
- error exporting signed apk - Dalvik format failed with error 1
More Query from same tag
- Should Eclipse Product Configuration Files be Edited in the workspace .metadata folder?
- Running Visual VM from eclipse
- Jersey restful webservices in java application tested with Postman plugin sending complex Objects
- Eclipse Activiti Designer Custom Extension
- SVN plugin for eclipse 4.14
- Eclipse JAXRS POST Request payload not converted into request model object
- Radio Buttons: Listener in XML or JAVA?
- Eclipse does not close ServerSocket completely
- Project lost in Eclipse
- Start Activity By Listactivity
- maven-surefire-plugin missing in eclipse
- D'pad Is disabled in emulator
- Use a class field in the 'plugin.xml' for an eclipse plugin
- generate auto increment in eclipse and testing JMETER without using database
- Encoding issue in Eclipse incorrectly displays UTF-8 characters that have no issue in other editors
- Android App: Press a button and open a new layout
- StartActivity crashes in ListView.setOnItemClickListener
- Setting a eclipse plug-in to singleton when creating a plug-in project via IPluginContentWizard interface
- null pointer exception in OnOptionItemSelected
- Turn off Eclipse formatter everywhere
- SlpashScreen/Performance: Proper way to initialize application data during startup especially using a SlpashScreen
- config.ini setup for headless eclipse
- How to add new Fields/Elements to JsonObject?
- Maven eclipse plugin: Use linked or virtual folders as source folders
- Executing .exe Files on ubuntu
- Maven test finds but not executes tests
- [Python][Pydev] Unknown encoding: MS950_HKSCS
- Hibernate in Eclipse: java.lang.ArrayIndexOutOfBoundsException at oracle.jdbc.driver.OracleSql.main(OracleSql.java:1032)
- Phonegap Android App "App not installed"
- How to get the contents of an InputStream?