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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With