user3678528
user3678528

Reputation: 1731

Getting error "The package appears to be corrupt" while installing apk file

I am having a weird problem.I got this error after I updated Android Studio from 2.3.3 to 3.0..The problem is when I try to install apk file it says

App not installed. The package appears to be corrupt.

I have tried generating apk in both debug and release version and tried to install but whenever I install apk it show the same message..

When I run the android project from android studio it is working. May be the gradle problem but couldn't fix it. Please help

Upvotes: 80

Views: 150464

Answers (11)

Akshay Chopra
Akshay Chopra

Reputation: 1253

By version number, I mean the versionCode in the app/build.gradle file

The Scenario: I have an APK installed. Its version number is 152430.

I was trying to install a new APK (by downloading the new APK file) and updating the existing app. The New APK was having version number : 152427

Since the New APK was having version number less than the already installed APK, it was throwing this error.

The solution: The version number needs to be higher than the installed APK version.

Upvotes: 0

Binish Manandhar
Binish Manandhar

Reputation: 21

In my case, I had a problem with my module level build.gradle file. I somehow had removed the line

compileSdkVersion 32

from the file. This didn't prompt any issue during the build time but only when installing which is where "The package appears to be corrupted" line occurred. Adding the line back solved my issue.

Please re-check your build.gradle and AndroidManifest for any anamolies since the corrupt message is very ambiguous and hard to debug the exact cause for the issue.

Upvotes: 0

Newtoxton
Newtoxton

Reputation: 186

Running a direct build APK will work. But make sure you uninstall any previously installed package of the same name.

Upvotes: 1

Qi Hao
Qi Hao

Reputation: 36

None of the answer is working for me.

As the error message is package corrupt , I will have to run

  1. adb uninstall <package name>
  2. Run app again / use adb install

Upvotes: 0

Ananta Prasad
Ananta Prasad

Reputation: 3859

In my case by making build, from Build> Build apks, it worked.

Upvotes: 0

Harsh Prajapati
Harsh Prajapati

Reputation: 590

This is weird. I don't know why this was happening with me while generating signed apk but below steps worked for me.

  1. Go to file and select invalidate caches/restarts
  2. After that go to build select clean project
  3. And then select Rebuild project

That's it.

Upvotes: 3

ArtHare
ArtHare

Reputation: 1836

In my case, the target phone had the app already installed, but in a "disabled" state. So the user thought it was already uninstalled, but it wasn't. I went to the main app list, clicked on the "disabled" app, uninstalled it, and then the APK would go on.

Upvotes: 1

tej shah
tej shah

Reputation: 3095

After searching a lot I found a solution:

Go to Build-> Build Apk(s).

After creating apk you will see a dialog as below.

enter image description here

Click on locate and install it in your phone

Enjoy

Upvotes: 135

Muhammed Refaat
Muhammed Refaat

Reputation: 9103

As I got this case at my own and the answers here didn't help me, my situation was because of I downgraded the targetSdkVersion in gradle app module file from 24 to 22 for some reason, and apparently the apk doesn't accept another one with downgraded targetSdkVersion to be installed over it.

So, once I changed it back to 24 the error disappeared and app installed correctly.

Upvotes: 9

Sabri Mevis
Sabri Mevis

Reputation: 2431

In my case; If you receive this error while updating your application, It may be because of the target SDK version. In such case you will receive this error on logs;

"Package com.android.myapp new target SDK 22 doesn't support runtime permissions but the old target SDK 23 does"

This is because your previous aplication was build with a higher version of sdk. If your new app was build with 22 and your installed application was build with 23, you will get The package appears to be corrupt error on update.

Upvotes: 2

Sangeet Suresh
Sangeet Suresh

Reputation: 2545

When you are releasing signed apk , please make sure you tick both v1 and v2 in signature versions

See below screenshot for more info Signed APK generation

Upvotes: 4

Related Questions