INSTALL_FAILED_INVALID_APK error with version 1 debug code incompatible with 0

I have created an Android app on Android Studio version 2.3.3. When I try to deploy an app on a phone (lennovo) or emulator (GenyMotion), I get an error:

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 seem to help

  • Was there a clean build followed by a restore after restarting Android Studio

  • Disconnected and reconnected devices

  • I deleted directories .idea

    , .gradle

    and build and build again

Any suggestions on how to solve this problem? What is the version code referenced here? I see one version code in 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 yet. BTW, I haven't used an Android emulator as they seem to take hours to get started. My processor is AMD, not Intel. I have ARM images loaded for emulators.

+5


source to share


3 answers


The problem could be caused by the Instant Run function of the new Gradle.



Try disabling Instant Run by going to File> Preferences> Build, Execution, Deployment> Instant Run

+15


source


Some strange circumstances can cause this. This works for me:

Build menu> Rebuild Project



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

+2


source


I have one such assembly, I wait a few minutes and then run it again. It works 90% of the time after that.

0


source







All Articles