Reputation: 841
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?
Upvotes: 83
Views: 187641
Reputation: 542
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!!
Upvotes: 11
Reputation: 135
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):
Upvotes: 0
Reputation: 432
I had the same issue but finally it worked after storage clean on my mobile. May be happen because of insufficient storage
Upvotes: 0
Reputation: 148
If you do all of things above and still get stuck, just try reopening your Android Studio.
Upvotes: 0
Reputation: 344
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.
Upvotes: 0
Reputation: 4800
The solution for me was : (in a Huawei)
Upvotes: 4
Reputation: 7
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.
Upvotes: 0
Reputation: 22394
Disable Instant Run
Preferences > Build, Execution, Deployment > Instant Run
Source: comment by @user77309
Upvotes: 45
Reputation: 338
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.
Upvotes: 0
Reputation: 276
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)
Upvotes: 0
Reputation: 421
I solve this problem by: Enable Instant Run
Settings>Build, Execution, Deployment>Instant Run
Upvotes: -1
Reputation: 2107
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.
Upvotes: 0
Reputation: 220
Recently I also find the same problem and there some reasons behind this but I am giving you 3
It must work.
Upvotes: 1
Reputation: 2557
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
Upvotes: 82
Reputation: 1998
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.
Upvotes: 3
Reputation: 759
I solved the issue by simply deleting my whole /build folder and rebuilding (menu Build > rebuild project).
Upvotes: 0
Reputation: 5250
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.
Upvotes: 4
Reputation: 69
android {
buildTypes {
debug {
debuggable true
}
and
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..
Upvotes: 0
Reputation: 3522
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
Upvotes: 8
Reputation: 1346
I got the same problem , just choose clean project then rebuild project from build menu , it's solved my problem
Upvotes: 58
Reputation: 2137
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.
Upvotes: 1
Reputation: 3629
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
Upvotes: 4
Reputation: 697
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)
Upvotes: 1
Reputation: 1489
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..!!!
Upvotes: 2
Reputation: 369
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.
Upvotes: 7
Reputation: 19
Uninstalling from AVD worked for me. After reinstalling it worked
Upvotes: 1
Reputation: 39
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.
Upvotes: 0
Reputation: 51
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]
Upvotes: 5
Reputation: 2358
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
Upvotes: 0