2

After I upgrade build gradle version to v3.1.3, Build getting failed with below error.

android-apt plugin is incompatible with the Android Gradle plugin.  Please use 'annotationProcessor' configuration instead.


Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

But, I have removed all the android-apt Uses from my gradle file.

I tried all the possible solution from stackoverflow and forums. But no-Luck.

Below is my app module's build.gradle

apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.1'
    defaultConfig {
        applicationId "com.appname.test"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 24
        versionName "1.5.2"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        resValue "string", "AUTH0_DEV_DOMAIN", AUTH0_DEV_DOMAIN
        resValue "string", "AUTH0_DEV_CLIENT_ID", AUTH0_DEV_CLIENT_ID
        resValue "string", "AUTH0_DEV_SCHEME", AUTH0_DEV_SCHEME
        resValue "string", "AUTH0_DEV_AUDIENCE", AUTH0_DEV_AUDIENCE
        resValue "string", "AUTH0_PROD_DOMAIN", AUTH0_PROD_DOMAIN
        resValue "string", "AUTH0_PROD_CLIENT_ID", AUTH0_PROD_CLIENT_ID
        resValue "string", "AUTH0_PROD_SCHEME", AUTH0_PROD_SCHEME
        resValue "string", "AUTH0_PROD_AUDIENCE", AUTH0_DEV_AUDIENCE
    }
    dexOptions {
        //   incremental true
        javaMaxHeapSize "4g"
    }
    buildTypes {
        debug {
            buildConfigField "String", "ENDPOINT", "\"https://domine url/\""
            ext.alwaysUpdateBuildId = false

        }
        release {
            buildConfigField "String", "ENDPOINT", "\"https://domine url/\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
    /* configurations.all {
         resolutionStrategy.force 'com.google.code.findbugs:jsr305:2.0.1'
     }
 */
    /*compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }*/
    productFlavors {
    }
}

retrolambda {
    jvmArgs '-noverify'
}


final ANNOTATIONS_VERSION = '28.0.0' //'26.0.0' 
final SUPPORT_VERSION = '28.0.0' //'26.0.0'
final RX_JAVA_VERSION = '1.1.6'
final RX_ANDROID_VERSION = '1.2.1'
final BUTTERKNIFE_VERSION = '8.8.1'
final DAGGER_VERSION = '2.2'
final PARCELER_VERSION = '1.1.5'
final DEXTER_VERSION = '2.2.2'
final OTTO_VERSION = '1.3.8'
final ICEPICK_VERSION = '3.2.0'
final TIMBER_VERSION = '4.1.2'
final RETROFIT_VERSION = '2.4.0'
//final PICASSO_VERSION = '2.5.2'

final DEXMAKER_VERSION = '1.2'
final RUNNER_VERSION = '1.0.2' //'0.4'
final ESPRESSO_VERSION = '3.0.2' //'2.2.2'

//////
//final RX_JAVA_VERSION = '1.3.8'
final RX_BINDING_VERSION = '1.0.0' // 2.2.0
//final DAGGER_VERSION = '2.17'
//final PARCELER_VERSION = '1.1.11'
//final DEXTER_VERSION = '5.0.0'
//final TIMBER_VERSION = '4.7.1'
final PICASSO_VERSION = '2.71828'
final MOCKITO_CORE_VERSION = '2.7.22'



dependencies {

    //    implementation fileTree(include: ['*.jar'], dir: 'libs')

    // Support library for android.
    implementation "com.android.support:support-annotations:${ANNOTATIONS_VERSION}"
    implementation "com.android.support:appcompat-v7:${SUPPORT_VERSION}"
    implementation "com.android.support:support-v4:${SUPPORT_VERSION}"
    implementation "com.android.support:design:${SUPPORT_VERSION}"
    implementation "com.android.support:cardview-v7:${SUPPORT_VERSION}"
    implementation "com.android.support:palette-v7:${SUPPORT_VERSION}"

    // dependency added to resolve conflict with auth0 customtabs

    // dependency using version 25
    implementation "com.android.support:customtabs:${SUPPORT_VERSION}"

    // Library needed for custom tab views.

    //implementation 'com.ogaclejapan.smarttablayout:library:1.6.0@aar'
    implementation 'com.ogaclejapan.smarttablayout:library:1.6.1'

    // Library for listview and gridview item animations

    //implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0'

    // Library needed for carousel views.
    implementation 'com.github.crosswall:Android-Coverflow:release-v1.0.1'

    // Library needed for horizontal line progress bar.
    implementation 'com.liulishuo.magicprogresswidget:library:1.1.1'

    // Library to eliminate findViewById and OnClick events (View injection).
    implementation "com.jakewharton:butterknife:${BUTTERKNIFE_VERSION}"
    annotationProcessor "com.jakewharton:butterknife-compiler:${BUTTERKNIFE_VERSION}"

    // Library which manages the DI throughout android.
    implementation "com.google.dagger:dagger:${DAGGER_VERSION}"
    annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"

    // compileOnly 'javax.annotation:jsr250-api:1.0'

    //compileOnly 'javax.annotation:jsr250-api:1.0-20050927.133100'

    // Library that eliminates the boilerplate code of creating Parcelable objects.
    implementation "org.parceler:parceler-api:${PARCELER_VERSION}"
    annotationProcessor "org.parceler:parceler:${PARCELER_VERSION}"

    // Library that eliminates the boilerplate code of granting permissions.
    implementation "com.karumi:dexter:${DEXTER_VERSION}"

    // Library for reactive java
    implementation "io.reactivex:rxjava:${RX_JAVA_VERSION}"
    implementation "io.reactivex:rxandroid:${RX_ANDROID_VERSION}"
    implementation 'com.cantrowitz:rxbroadcast:1.0.0'

    // implementation 'com.cantrowitz:rxbroadcast:2.2.0'
    implementation "com.jakewharton.rxbinding:rxbinding:${RX_BINDING_VERSION}"
    implementation "com.jakewharton.rxbinding:rxbinding-support-v4:${RX_BINDING_VERSION}"

    // Library to be used as an event bus.
    implementation "com.squareup:otto:${OTTO_VERSION}"

    // Library for efficient logging.
    implementation "com.jakewharton.timber:timber:${TIMBER_VERSION}"

    // Retrofit library used to manage request asynchronously.
    implementation "com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}"
    implementation "com.squareup.retrofit2:converter-gson:${RETROFIT_VERSION}"
    implementation "com.squareup.retrofit2:adapter-rxjava:${RETROFIT_VERSION}"
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'

    // Library to load images.
    implementation "com.squareup.picasso:picasso:${PICASSO_VERSION}"

    // Library for bottom navigation menu.
    implementation 'com.roughike:bottom-bar:1.4.0.1'
    implementation 'com.ncapdevi:frag-nav:1.0.3'
    implementation('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
        exclude module: 'support-v4'
    }

    //implementation 'me.relex:circleindicator:1.2.1@aar'
    implementation 'me.relex:circleindicator:1.2.2'
    implementation 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.15'

    // Library for authentication with Auth0.

    //implementation 'com.auth0.android:auth0:1.12.1'
    implementation 'com.auth0.android:auth0:1.14.1'

    // implementation 'com.klinkerapps:link_builder:1.6.1'
    implementation 'com.klinkerapps:link_builder:2.0.4'

    // Library for ui tag view layout
    implementation 'com.github.Cutta:TagView:1.3'

    // Library for timeline view
    implementation 'com.github.vipulasri:timelineview:1.0.6'

    //++  implementation 'com.github.vipulasri:timelineview:1.0.4'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
    }
    implementation 'com.airbnb:deeplinkdispatch:3.0.0'
    annotationProcessor 'com.airbnb:deeplinkdispatch-processor:3.0.0'
    testImplementation 'junit:junit:4.12'

    // testImplementation 'com.google.truth:truth:0.25'
    testImplementation 'com.google.truth:truth:0.42'
    testImplementation 'com.squareup.okhttp3:mockwebserver:3.11.0'
    testImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"

    //++ testImplementation 'org.mockito:mockito-core:2.23.0'
    testImplementation 'org.robolectric:robolectric:3.4.2'
    testImplementation 'org.assertj:assertj-core:3.6.2'
    testImplementation 'org.json:json:20180813'

    // Support library for android.
    androidTestImplementation "com.android.support:support-annotations:${ANNOTATIONS_VERSION}"

    // Library for the test runner
    androidTestImplementation "com.android.support.test:runner:${RUNNER_VERSION}"
    androidTestImplementation "com.android.support.test:rules:${RUNNER_VERSION}"

    // not available

    // Library for UI testing
    androidTestImplementation "com.android.support.test.espresso:espresso-core:${ESPRESSO_VERSION}"
    androidTestImplementation "com.android.support.test.espresso:espresso-intents:${ESPRESSO_VERSION}"

    // not available

    // Library for mocking
    androidTestImplementation "com.google.dexmaker:dexmaker:${DEXMAKER_VERSION}"
    androidTestImplementation "com.google.dexmaker:dexmaker-mockito:${DEXMAKER_VERSION}"

    //androidTestImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"

    // Library which manages the DI throughout android.
    androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
    testAnnotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
    androidTestImplementation "org.mockito:mockito-android:${MOCKITO_CORE_VERSION}"
    implementation files('libs/nineoldandroids-2.4.0.jar')
}

Below is Application level build.gradle

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url 'https://maven.fabric.io/public' }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath "io.realm:realm-gradle-plugin:1.2.0"
        classpath 'io.fabric.tools:gradle:1.22.1'
        classpath 'me.tatarka:gradle-retrolambda:3.2.3'
        classpath 'me.tatarka:gradle-retrolambda:3.2.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
        maven { url "https://clojars.org/repo/" }
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url 'https://maven.fabric.io/public' }
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Can someone please help me to resolve. My Android studio version is 3.2 I have tried clean, rebuild, invalidate & restart studio, restarts Computer also

Raj
  • 1,843
  • 2
  • 21
  • 47
  • Did you remove `android-apt plugin`? There are two duplicate classpaths in your build.gradle too. – ʍѳђઽ૯ท Oct 09 '18 at 17:22
  • check here: https://stackoverflow.com/a/42574851/8034839 – shizhen Oct 10 '18 at 00:58
  • @Mohsen : Thanks for the response. I remove android-apt plugin & I tried removing the duplicates also. But it same. – Raj Oct 10 '18 at 10:52
  • @shizhen : Thanks for response. I already tried that solution before posting this question itself. didn't worked for me. – Raj Oct 10 '18 at 10:54

0 Answers0