1

I've updated Android Studio to the latest canary my app wont build now.
I tried adding version code manually.
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>
Rishav
  • 3,818
  • 1
  • 31
  • 49

1 Answers1

2

EDIT:

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:

Android Studio 3.0 Canary 2: attribute 'android:versionCode' not found

alexpfx
  • 6,412
  • 12
  • 52
  • 88
  • Well instant run is very important for me as for now and as I said I tried that. It does fix it perhaps. But isn't there a workaround without disabling instant run. – Rishav Jun 12 '17 at 03:27
  • I can confirm this is still problem on Android Studio 3.0 Canary 5 Build #AI-171.4141229, built on June 28, 2017 JRE: 1.8.0_152-release-884-b01 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 as well. – Maytham Fahmi Jul 03 '17 at 09:53