I’m updating an old android project to build and run in the newest version of gradle, but I’m stuck in this error, and I don’t know how to get over it.
The error when building my android studio project:
A problem occurred configuring root project 'app'.
> com.android.builder.errors.EvalIssueException: android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
I don’t know what I’m doing wrong.
My gradle project:
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "io.realm:realm-gradle-plugin:1.2.0"
}
}
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 33
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.egpv.ponton"
minSdkVersion 22
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.android.support:recyclerview-v7:30.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.8.0'
implementation 'com.squareup.retrofit2:converter-gson:2.8.0'
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
implementation 'com.karumi:dexter:6.2.2'
// implementation 'gr.escsoft.michaelprimez.searchablespinner:SearchableSpinner:1.0.9'
implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
}
I could’nt find any related problem in the stackoverflow that worked for my case.