[android] Installation failed with message Invalid File

Installation failed with message Invalid File: K:\project\app\build\intermediates\split-apk\with_ImageProcessor\debug\slices\slice_0.apk. 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 am running my project in android studio 2.3 beta 3 .

This question is related to android android-studio android-build

The answer is


Hopefully, this should solve your problem.

Do follow the following steps.

1. Clean your Project

Cleaning the project

2. Rebuild your project

Rebuilding the project

3. Finally Build and Run your project


Try this in gradle project dependencies { classpath 'com.android.tools.build:gradle:2.2.3' }


follow some steps:

Clean Project
Rebuild Project
Invalidate Caches / Restart

Now run your project. Hope it will work.

It's work for me.


In my case , there was a single qutation ' in project directory and after removing it resolved


First, as already mentioned, try cleaning and rebuilding the project. If that does not work for you, try this:

Settings > Build, Execution, Deployment: Un-check Enable Instant Run to hot swap code...

This solved the problem right away for me.

P.S. I posted this answer since it's 2017 and I don't think this feature existed in 2014, so it wouldn't cause this problem.


For me it's:

Click Build tab ---> Clean Project

Rebuild Project

Build APK


Work for me:

  1. Delete these folders
  2. Run app

enter image description here


Delete the Intermediate folder after then run the project is working fine actually that APK builds to another system. Go to app/build/intermediates.


I solved it this way:

Click Build tab ---> Clean Project

Click Build tab ---> Rebuild Project

Click Build tab ---> Build APK

Run.


None of the answers here worked, I had to:

  1. Close android studio
  2. rm -rf ./android/.idea
  3. Build -> Build Bundle/APK(s) -> Build APK(s)

This happened with me when I copied a project code from one laptop to another one and tried running the project. What fixed this for me was:

  1. Delete the project's build folder
  2. Clean Project
  3. Build project
  4. Run

Just follow two steps

Step 1 : Build---> Clean

Step 2 : Build--> Build APK

Hope it works. Good luck guys


Try cleaning the project and rebuild, if doesn't work try disabling the Instant Run from Settings>Build>Instant Run in case you are running someone else's code.


I found its work by restarting my phone :)


Please follow the below steps File > Settings > Build,Execution,Deployment > Instant Run > Un-check (Enable Instant Run to hot swap code)

this is working for me

thanks


Click Build tab ---> Clean Project

Click Build tab ---> Build APK

Run.


My issue was with my Android Studio install.

I am building out a new CI server and although I installed Android Studio and hooked up the SDK, etc., I did not open the studio with the project -- instead just went to the command line to build. When I subsequently opened the project in the studio, it started prompting for all sorts of updates. Followed the bouncing-ball and then I was able to reach my USB tethered device.

Hopefully, this is helpful for Build Master and DevOps as a "got-cha" to avoid.


In my case, I had the same issue when the name of my project contains a "&" sign.The solution is to rename the project name,from file browser, so it doesn't contain any "&" signs and then from:

  • Build menu-> Clean Project
  • Build menu-> Build APK

I've tested it two times and it worked just fine.


  1. Invalidate cache/restart
  2. Clean Project
  3. Rebuild Project
  4. Run your app / Build APK

These steps are enough to solve most of the problems related to Gradle build in any way. These steps helped me solve this problem too.


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to android-build

Installation failed with message Invalid File failed to find target with hash string android-23 What is the difference between compileSdkVersion and targetSdkVersion? Gradle, Android and the ANDROID_HOME SDK location Android Studio: Plugin with id 'android-library' not found How to install Android SDK Build Tools on the command line?