如何修复AAPT2警告[Android Studio 3.3中不推荐使用以下项目选项,并已将其删除:android.enableAapt2]

时间:2019-01-15 07:36:17

标签: android android-studio kotlin build.gradle android-studio-3.3

构建我的应用时。将 Android Studio版本更新为 3.3 并更新gadler插件等后,我得到了警告

enter image description here

这是我的 build.gradle(Module:App)

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.jirin.kollinapp"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
}

gradle.properties

org.gradle.jvmargs=-Xmx1536m
android.enableAapt2=false

1 个答案:

答案 0 :(得分:10)

默认情况下,Gradle 3+似乎启用了AAPT2。

确保更新至Gradle 3.3.0。然后洗干净。

警告仅告诉您从gradle.properties中删除{Binding View.IconSource, RelativeSource={RelativeSource AncestorType=ListView}}