Android Studio: Application Installation Failed

I've been trying to learn how to use Android Studio but when I attempted to run one of the sample programs I get this error message:

Installation failed with message null. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

I've tried to do this on 5 more sample programs and all of them give me this error. Does anyone know how to solve this?

184563 次浏览

Go to Settings > Applications. Probably you have the app still installed for other users (I had the same problem with a Moto G, I did not see the app among other apps, but it still was among my apps in Settings). Try to find it and remove for all users.

If the problem is this one you will find the app at the end of the list (in Settings > Apps > All)

All the apps marked as "Not installed" are still there and you can not install the same apps with Android Studio until they are there

Happened to me as well: At the first time, it says- Failure [INSTALL_FAILED_CONFLICTING_PROVIDER] At the second time, it says- DELETE_FAILED_INTERNAL_ERROR

This because of the new 'com.google.android.gms' version 8.3.0

Changing it back to 8.1.0 solved the problem in my case

INSUFFICIENT_STORAGE

Solution:clean you phone storage

Pay attention Android Studio log:

open: Permission denied
open: Permission denied
pkg: /data/local/tmp/com.example......... Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]

I was having the same error, but i fixed it after reinstalling the HAXM. This problem is caused because of the virtual device not starting properly. If your device keep showing on screen "Android" or the screen is black, it have not started yet, you have to wait more for it to start properly, then it shall run. If it is too slow, maybe you should find a way to accelerate the Android Virtual Device (AVD). The Intel computers have the HAXM (hardware-accelerated-execution-manager).

In my computer was not starting because of the HAXM not working, I fixed it by reinstalling the HAXM, downloading it from the intel website: "https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager"

Then i set the HAXM max memory to 1536MB in the installation, for not having the problem of this other post, that you maybe have and i was having too: "HAXM configuration in android studio"

After all done, it worked fine.

Uninstalling from AVD worked for me. After reinstalling it worked

This happens when your app is using any library and there is also an app installed in your device that is using the same library. Go to gradle and type:

android{
defaultConfig.applicationId="your package"
}

this will resolve your problem.

In real device do below tasks..

1.clean all cache memory.

2.check the internal storage space (if space is just 500 mb free, then remove some data or app in the internal storage maintain at least 1 gb space.

3.again do clean all cache memory.

4.now goto android studio or eclipse click on app goto run select the device and run I hope app will install and it will run..!!!

Step 1: Go to "Setting" → find "Developer options" in System, and click.

Step 2: TURN ON "Verify apps over USB" in Debugging section.

Step 3: Try "Run app" in Android Studio again!

            and you should also TURN ON following fields inside "Developer option" .....

1: TURN ON ->"Install via USB" field

For the 1st time installation of apps in a device, enable developer option which is mentioned in the above post. For facing problem while installing the apps from the tool, follow the below steps....

By enabling an option in settings, you can install apps directly. Error will disappear.

For MI users: Go to Settings-> Additional settings-> Privacy-> Unknown sources (make it enable) For Normal Users: Go to Settings-> Security -> Unknown sources (make it enable)

Simply closing Android Studio (and emulator) then re-opening fixed it for me. Once I ran the app again, the apk re-installed successfully and app ran properly.

I got the same problem , just choose clean project then rebuild project from build menu , it's solved my problem

android {
buildTypes {
debug {
debuggable true
}

In the AndroidManifest.xml file, add android:debuggable="true" to the <application> element.

https://developer.android.com/studio/run/device.html#setting-up

it works for me..

Some solutions:

1 Build -> Clean Project

2 Build -> Rebuild Project

3 Built -> Make Project

4 Remove your application from device and try install again

5 Mb you have some problems with actual version of yours app(try to pull actual branch). Also you can check on your emmulator, if yours app is running.

6 Try to use 1,2,3,4 solutions.

I'm Using Redmi 3s mobile. I got same problem.

Solution: This issue is common on Xiaomi phones running MIUI 8. This can resolved by turning off MIUI optimizations from Developer Options in Settings app. Then recompile the app and voila it works.

Settings --> Additional settings --> Developer options --> Turn Off MIUI optimization

Or

Settings --> Developer options --> Turn Off MIUI optimization

I solved the issue by simply deleting my whole /build folder and rebuilding (menu Build > rebuild project).

I had the same issue, and found that it was the USB cable I was using that was causing the issue.
Changing the USB cable fixed the issue, and I could successfully install the app afterwards.

Disable Instant Run

Preferences > Build, Execution, Deployment > Instant Run

Source: comment by @user77309

enter image description here

Recently I also find the same problem and there some reasons behind this but I am giving you 3

  1. In your phone in the setting go to "Developer Option" and enable USB debugging
  2. Also, check the "Install via USB" is also on in Developer Option itself.
  3. In Android Studio go to File -> Settings -> Build, Execution, Deployment -> Instant Run and uncheck the Enable Instant Run

It must work.

This problem cause to me because of the project path . Y:\Example&SourceCode with & sign So i change the Project path to another one without special characters. Now It is Fine.

I solve this problem by: Enable Instant Run

Settings>Build, Execution, Deployment>Instant Run

Path: Android Studio Preference / Build, Execution, Deployment / Instant Run

Go to Android Studio Preference (for Mac) or Settings (for windows)

Choose Build, Execution, Deployment tab

Choose Instant Run

Uncheck Enable Instant Run to hot swap code/resources changes on deply (default enabled)

It works for me!!

For me it only started working after I rebooted device (Motorola-Nexus-6).

(I also tried to clean, disable "instant run", reopen Android Studio, verified installed applications to be sure there are no clashes, disable and reenable Debug mode in phone, reconnect USB cable)

I have faced this issue since I have upgraded the build tools from 26.0.2 to 27.0.3. Reverting back, clean and rebuild solve the issue. Also I have degraded the gradle plugin version from 3.1.3 to 3.0.1 as the latest version was overriding the build tools to latest version.

I also got same problem while generating signed APK. Just select APK signature scheme v1, not v2 (introduced in in Android 7.0). If you select v2 scheme it won't work on devices that use Android versions older than 7.0.

The solution for me was : (in a Huawei)

  • Android Studio -> Build -> Clean Project
  • In the phone -> go to Phone Manager -> Cleanup and Optimize

if your "versionCode" in build.gradle file is less than the eralier version code then, your app wont install. Try to install with same "version code" or more than that.

If you do all of things above and still get stuck, just try reopening your Android Studio.

I had the same issue but finally it worked after storage clean on my mobile. May be happen because of insufficient storage

I have a Redmi K20, the following is MI, Redmi specific that I learned in a hard way

How I ended up in the error: I uninstalled the debug app from the phone because my assets were not accessible (maybe I had faulty source code)

Solution (steps that worked for me in sequence):

  1. Uninstall the app
  2. As per suggestion above by @Jayaprakash G and all, I turned off MIUI optimization
  3. I tried finding "Instant Run", but seems missing in Android Studio 3.6.2
  4. MI supports "Second Space", switch to it. You'll observe the app is still there. Again uninstall.
  5. Switch space back to original again. By any chance, if you see the same app in frequently used app in the app drawer, again uninstall.
  6. Try to compile and run the app from Android Studio and let it show in the app phone (Error 3 will be still there, but installation will succeed).
  7. Clean the project, close Android Studio
  8. Start Android Studio, now everything will work as normal without the Error 3