Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INSTALL_FAILED_INVALID_APK error with debug version code 1 inconsistent with 0

I have built an Android app on Android Studio version 2.3.3. As I try to deploy the app to a phone (lennovo) or an emulator (GenyMotion) I get an error, which says:

INSTALL_FAILED_INVALID_APK: /data/app/vmdl235652946.tmp/4_yCommerceApp-b_c-dev-debug version code 1 inconsistent with 0.

I have looked at various posts here and tried the approaches below, none of which seems to help

  1. Did a clean build followed by a rebuild after a restart of the Android Studio

  2. Disconnected and reconnected devices

  3. I deleted the .idea, .gradle and build directories and built again

Any suggestions to solve this pls? What is the version code being referred to here? I see one version code in the AndroidManifest.xml like below:

<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0">      

I don't see any other version code anywhere else. BTW, I did not use an Android emulator as they seem to take hours to start. My processor is AMD and not Intel. I have the ARM images downloaded for the emulators.

like image 451
user132797 Avatar asked Jul 02 '17 11:07

user132797


2 Answers

The trouble maybe caused by Instant Run feature of new Gradle.

Try disable Instant Run by going into File > Settings > Build, Execution, Deployment > Instant Run

like image 59
thyzz Avatar answered Oct 30 '22 02:10

thyzz


Some strange circumstances might cause this. That works for me:

Menu "Build" > "Rebuild Project"

Then run app on device or emulator, and error goes away.

like image 35
naXa Avatar answered Oct 30 '22 03:10

naXa