Reputation: 359
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
Did a clean build followed by a rebuild after a restart of the Android Studio
Disconnected and reconnected devices
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.
Upvotes: 5
Views: 9200
Reputation: 16103
I have this once every so many build, I wait a few moments and then run it again. In 90% of the situations it works after that. Not really the best solution, but it does work (where the other solution didn't change anything).
Upvotes: 0
Reputation: 37896
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.
Upvotes: 2
Reputation: 724
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
Upvotes: 17