android:versionCode not found after update


I've updated Android Studio to the latest canary my app wont build now. <br />I tried adding version code manually.<br /> I already tried


File > Invalidate Caches & Restart


and it didnt work. Here is my build.gradle

apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.rishav.sql" minSdkVersion 25 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' }

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }

Here is my Manifest

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.rishav.sql"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>



This bug was resolved in the last Canary release:

Android Studio 3.0 Canary 4 Build #AI-171.4101728, built on June 14, 2017 JRE: 1.8.0_112-release-736 amd64

Just update android studio.


Disable instant run in Android Settings. It seems to be no solution to this problem with the instant run on, for now.

I tried all the solutions pointed out in this thread and nothing worked:

<a href="https://stackoverflow.com/questions/44225780/android-studio-3-0-canary-2-attribute-androidversioncode-not-found" rel="nofollow">Android Studio 3.0 Canary 2: attribute 'android:versionCode' not found</a>


  • working with UIautomator 2.0 and Android Studio 2.x
  • android.support.v4.content.FileProvider class not found in android Kitkat
  • Reflecting a decorator pattern in mysql database table
  • Android testing give a IllegalStateException: No instrumentation registered
  • WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'varia
  • Accessibility test automation on Android
  • Swift 'Could not build Obj-C module 'BranchInvite'
  • error while inflating class android.support.v7.widget.CardView
  • java.util.zip.ZipException: duplicate entry: AbstractHttpContent.class
  • problems with 'com.android.support:appcompat-v7.27.1.1' in the gradle file
  • Found com.google.android.gms:play-services-places:9.2.1, but version 9.0.2 is needed for the google-
  • SCons libraries and sub-libraries
  • How do I obtain a list of files that changed from svn over a date range?
  • integrate POCO library in android ndk
  • How to load Q library with Require.js?
  • Unzip archive in .Net CORE 1.0
  • Changing Jupyter Notebook start up folder by modifying “start in” not working any more
  • NUnit 3.0 TestCase const custom object arguments
  • msbuild create itemgroup from property group
  • Angular2 component view does not update on value change via method
  • List images(01.png) and descriptions(01.txt) from directory
  • CakePHP ACL tutorial initDB function warnings
  • Copy to all folders batch file?
  • Adjust width of select element according to selected option's width
  • Unable to install Git-core+svn by MacPorts
  • Eloquent paginate function in Slim 3 project using twig
  • How to determine if there are bytes available to be read from boost:asio:serial_port
  • Groovy: Unexpected token “:”
  • How do I exclude a dependency in provided scope when running in Maven test scope?
  • How to test if a URL from an Eclipse bundle is a directory?
  • $wpdb not working in file of WordPress plugin
  • Meteor helpers not available in Angular template
  • Read text file and split every line in MSBuild
  • Why is the timeout on a windows udp receive socket always 500ms longer than set by SO_RCVTIMEO?
  • SetUp method failed while running tests from teamcity
  • Buffer size for converting unsigned long to string
  • Hits per day in Google Big Query
  • Understanding cpu registers
  • Qt: Run a script BEFORE make
  • How to get Windows thread pool to call class member function?