acvilarim
acvilarim

Reputation: 49

Android Build and Installation error: INSTALL_PARSE_FAILED_NOT_APK

enter image description here

Have these erro when i'm trying to build the apk to some devices. Have no idea whats going on.

I get that when i build and install apk on device at the first time.

Someone have some tips for that?

[[EDIT]]

Well, after creating a debug key on keystore, i can build and deploy the apk via ADP to the device. But, dont know why, the error just return...

And now, we have other error:

enter image description here

UPDATE:

I Fix that issue removing all Android SDK and Android Studio and ReInstall it.

Upvotes: 2

Views: 16331

Answers (5)

James Ohia
James Ohia

Reputation: 21

The problem is most likely because of your ADB location. You can solve this by toggling the automatic ADB location and choosing the ADB location itself manually

Steps:-

  1. Open your emulator from Device Manager in Android Studio
  2. Click on the three dots at the right-hand side of your emulator
  3. Click on Settings
  4. Edit the ADB location to the one located in your system. You can find this usually following this pattern /Users//Library/Android/sdk/platform-tools/adb 5.Then drag and drop your apk to the emulator. It should install nowInstall APK on Emulator using manual ADB location

Upvotes: 0

Shreyash.K
Shreyash.K

Reputation: 1148

This error can also occur if you recently switched branch which had different build variants declared in build.gradle file and you didn't perform gradle sync.

For example you had release and debug and then you switched to branch which has releas, deubg and staging variants; your project will still build but while installing apk this error can pop up.

Upvotes: 0

Sohail Pathan
Sohail Pathan

Reputation: 346

The reason is you are trying to install the application with the same package name. If you have already downloaded the same application from the play store /app market, then simply uninstall that application and RE-RUN.

Upvotes: 1

Ariel
Ariel

Reputation: 1119

The problem can be solved by addding the install flags -r -t in the Run/Debug Configuration Dialog like it's showed in the given image enter image description here You can find Run/Debug Configuration Dialog location here according to Jetbrains. UPDATE: Depending on the Android Studio version the Run/Debug Configuration position in the IDE can be slightly different, but always refer Jetbrains to find whatever you are looking for

Upvotes: 8

Mapsy
Mapsy

Reputation: 4272

When you've installed an APK from another source, Android Studio warns you before overwriting.

For example, if I've developed an application, uploaded it onto the Google Play Store, downloaded it, then try to re-deploy that same application from Android Studio, I'll get this warning.

It's trying to tell you that the way the package is signed is different; it's warning you that another app might be masquerading as the original.

Upvotes: 2

Related Questions