在android studio 3.0中升级到gradle 3.0版本时出现错误

问题描述 投票:3回答:2

我想更新我的项目在android studio 3.0中运行。在更新时我遇到了apt的错误。我改变了我的完整build.gradle意味着所有编译到实现。这是我的build.gradle文件。

这是我的错误:

错误:android-apt插件与Android Gradle插件不兼容。请改用'annotationProcessor'配置。

这是我的build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'


android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.sample"
        minSdkVersion 19
        targetSdkVersion 26
        multiDexEnabled true
}
lintOptions {
    checkReleaseBuilds false
    abortOnError false
}
configurations{
    all*.exclude module: 'servlet-api'
}
dexOptions {
    javaMaxHeapSize "4g"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'

   }
   configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-annotations:26.0.2'
    }
}

}

dependencies {
implementation project(':androidHorizontalListView')
implementation project(':library')
implementation project(':simpl3r')



implementation  'com.google.code.gson:gson:2.2.4'
implementation  files('libs/acra-4.5.0.jar')
implementation  files('libs/bugsense-3.6.jar')
implementation  files('libs/espresso-1.1-bundled.jar')
implementation  files('libs/sample-2.4.1.jar')
implementation  files('libs/signpost-commonshttp4-1.2.1.1.jar')
implementation  files('libs/signpost-core-1.2.1.1.jar')
implementation  files('libs/twitter4j-core-4.0.2.jar')
implementation  files('libs/universal-image-loader-1.9.2-SNAPSHOT-with-sources.jar')
implementation  files('libs/volley.jar')
implementation  files('libs/YouTubeAndroidPlayerApi.jar')
implementation  files('libs/gcm.jar')
implementation  files('libs/mint-5.2.1.jar')
implementation project(':swipelibrary')


implementation  files('libs/glide-3.7.0.jar')
implementation  files('libs/glide-3.7.0-javadoc.jar')
implementation  'org.jsoup:jsoup:1.8.3'
implementation  'org.mozilla:rhino:1.7.7'
implementation  'info.guardianproject.netcipher:netcipher:1.2'
implementation  'com.nineoldandroids:library:2.4.0'
implementation  'com.thefinestartist:utils:0.9.1'
apt 'com.thefinestartist:compilers:0.9.1'
implementation  'com.android.support:recyclerview-v7:26.0.2'
implementation  'in.srain.cube:grid-view-with-header-footer:1.0.12'
implementation  'joda-time:joda-time:2.9.2'
implementation  'com.writingminds:FFmpegAndroid:0.3.2'

//implemented retrofit.
testImplementation 'junit:junit:4.12'


implementation  'com.android.support:appcompat-v7:26.0.2'
implementation  'com.squareup.retrofit:retrofit:1.9.0'

implementation  'com.google.android.gms:play-services-analytics:10.2.1'
implementation  'com.facebook.android:facebook-android-sdk:4.26.0'

implementation  'com.android.support:design:26.0.2'
implementation  'com.flurry.android:analytics:6.3.1'
implementation project(':sample-chat')


implementation  'com.quickblox:quickblox-android-sdk-core:3.1.0'
implementation  "com.google.android.gms:play-services-gcm:10.2.1"


implementation project(':sample-core')

}
android gradle apt
2个回答
0
投票

您可以通过this answer启用注释处理,然后您可以删除该行

apply plugin: 'com.neenbedankt.android-apt'

并替换

apt 'com.thefinestartist:compilers:0.9.1'

annotationProcessor 'com.thefinestartist:compilers:0.9.1'


0
投票

1)从项目的build.gradle文件中删除以下行:

apply plugin: 'com.neenbedankt.android-apt'

2)替换:apt 'com.thefinestartist:compilers:0.9.1'

annotationProcessor 'com.thefinestartist:compilers:0.9.1'

3)转到gradle.properties编写以下代码并同步您的项目:android.enableAapt2=false

解决com.android.tools.aapt2.Aapt2Exception:AAPT2错误

© www.soinside.com 2019 - 2024. All rights reserved.