1

I have made an android studio project and then there was a prompt to upgrade my gradle version. I did so and then it did some downloads and it got updated. After that, I cleaned the project and then I received this error: - . I am also receciving some errors like "Failed to evaluate values files".

\app\build.gradle' line: 1

A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'. The option 'android.enableSeparateAnnotationProcessing' is deprecated. The current default is 'false'. It was removed in version 4.0 of the Android Gradle plugin. This feature was removed in AGP 4.0

    apply plugin: 'com.android.application'
apply from: '../config/checkstyle.gradle'

android {
    compileSdkVersion 30
    buildToolsVersion '30.0.2'
    defaultConfig {
        applicationId "hardik.document_scanner"
        vectorDrawables.useSupportLibrary = true
        minSdkVersion 21
        multiDexEnabled true
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
    }
    lintOptions {
        checkReleaseBuilds false
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
            returnDefaultValues = true
        }
    }
}
configurations {
    all {
        exclude module: 'httpclient'
    }
}
repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
    maven { url "https://repository.aspose.com/repo/" }
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'junit:junit:4.12'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.multidex:multidex:2.0.0'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.preference:preference:1.0.0'
    implementation 'com.android.support:support-annotations:28.0.0'

    // persistence room library - for db operations
    implementation 'androidx.room:room-runtime:2.0.0'
    annotationProcessor 'androidx.room:room-compiler:2.0.0'

    implementation 'com.jakewharton:butterknife:10.2.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'

    // material ripple, morphing button, material dialog, animations
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56'
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
    implementation 'com.airbnb.android:lottie:2.5.5'

    // libraries for reading from doc and docx files
    implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '2.4.0'
    implementation group: 'org.apache.poi', name: 'poi', version: '3.9'
    implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
    implementation group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: '3.9'
    implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: '3.9'

    // Itext hardik library
    implementation 'com.itextpdf:itextg:5.5.10'
    implementation 'com.madgag.spongycastle:core:1.58.0.0'

    // Picasso, image editor, image cropper
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'jp.wasabeef:picasso-transformations:2.2.1'
    implementation 'ja.burhanrashid52:photoeditor:0.2.1'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

    // Viewpager transformation
    implementation 'com.eftimoff:android-viewpager-transformers:1.0.1@aar'

    // Image picker, and folder picker
    implementation 'com.zhihu.android:matisse:0.5.3-beta3'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'lib.kashif:folderpicker:2.4'
    // Zxing - for scanning qr code
    implementation 'com.google.zxing:core:3.2.1'
    implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
    // color picker
    implementation 'com.github.danielnilsson9:color-picker-view:1.4.0@aar'

    testImplementation 'org.mockito:mockito-core:2.23.4'
    testImplementation 'org.robolectric:robolectric:4.3.1'

    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'com.google.android.gms:play-services-ads:19.4.0'
    implementation 'com.facebook.android:audience-network-sdk:5.11.0'
}
preBuild.dependsOn('checkstyle')
assemble.dependsOn('lint')
check.dependsOn('checkstyle')

the module level gradle file:-

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

buildscript {
    repositories {
        maven {
            url "https://jcenter.bintray.com"
        }

        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

and this is the checkstyle.gradle file:-

apply plugin: 'checkstyle'

dependencies {
    checkstyle 'com.puppycrawl.tools:checkstyle:7.6.1'
}

def qualityConfigDir = "$project.rootDir/config/"
def reportsDir = "$project.buildDir/reports"

check.dependsOn 'checkstyle'

task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code style checks') {
    configFile file("$qualityConfigDir/checkstyle_config.xml")
    source 'src'
    include '**/*.java'

    reports {
        xml.enabled = true
        xml {
            destination file("$reportsDir/checkstyle/checkstyle.xml")
        }
    }

    classpath = files( )
}

Any help is appreciated

0 Answers0