78
votes

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

9
answer few things, 01. What is your package name? 02. Is that app already installed in your device? 03. Was this working before upgrading your studio? 04. Did you checked your device settings, "Install from external sources". - Aman Shekhar
1) Are you using the emulator? 2)is there any other app with the same package name in your device? - Ronak Thakkar
@Shekhar.. 01. My package name is similar before updating android studio.. 02. I tried both ways.. keeping old version app in device as well as uninstalling old app.. 03.. Yes it was working before updating android studio.. 04. Yes, it is already checked.. - user3678528
@Ronak Thakkar.. 1)I am using emulator as well as physical device. one at a time.. 2) No there aren't any other app with the same package.. - user3678528
and in both emulator and physical device you get the same error? - Ronak Thakkar

9 Answers

133
votes

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

8
votes

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.

4
votes

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

2
votes

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.

2
votes

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.

1
votes

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.

0
votes

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

0
votes

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
0
votes

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