skip to Main Content

I’ve just updated my android studio to android studio arctic fox and also I’ve updated some of my plugins. I also updated Gradle to Gradle 7.0 in the middle of Gradle building , I faced this error. I tried some solutions like adding or removing applicationId in my presentation gradle module and also in my conductor but none of them helped. I tried the solution said that applicationId have to be exactly the same in manifest file package name but It didn’t work out.I’m sharing my presentation and conductor gradle module so If it needs more to be shared please tell me.
So what should I do now ?

Presentation gradle module:

plugins {
id ("com.android.library")
id ("kotlin-android")
id ("com.google.gms.google-services")
}

android {
    compileSdkVersion (30)
    buildToolsVersion ("30.0.2")

defaultConfig {
    minSdkVersion (19)
    targetSdkVersion (30)

    testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
    getByName("release") {
        this.isMinifyEnabled = false
        proguardFiles (getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
    }
}
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = "1.8"
}
}
//dependencies

Conductor(App) gradle module:

plugins {
id("com.android.application")
id("kotlin-android")
this.kotlin("kapt")
//    id("dagger.hilt.android.plugin")

}

android {
    compileSdkVersion(30)
    buildToolsVersion ("30.0.2")

defaultConfig {
    applicationId = "ir.raamaan"
    minSdkVersion (19)
    targetSdkVersion (30)
    versionCode = 1
    versionName = "1.0"
    multiDexEnabled = true

    testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    getByName("release") {
        this.isMinifyEnabled = true
        proguardFiles (getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
    }
}
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = "1.8"
}
}

3

Answers


  1. This error goes away with Android Gradle Plugin Version 7.1.0-alpha05.

    Open File>Project Structure>Project & Update your version.
    
    
    Alternatively,
    //In your Top-level build file, update this in your dependencies section 
    classpath 'com.android.tools.build:gradle:7.1.0-alpha05'
    
    Login or Signup to reply.
  2. I got this same error while upgrading gradle:

    com.android.tools.build:gradle:7.0.4 --> 7.2.1
    

    And the solution that worked for me was to update the kotlin-gradle-plugin (I had to solve sintax errors after this like the exhaustive "when" error):

    org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.7 --> 1.7.0
    
    Login or Signup to reply.
  3. Worked when Android Gradle Plugin Version was downgraded to 7.1.3

    classpath 'com.android.tools.build:gradle:7.1.3'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search