Cannot query the value of property 'applicationId' because configuration of project ':presentation' has not completed yet

Viewed 8385

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"
}
}
4 Answers

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'

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

Worked when Android Gradle Plugin Version was downgraded to 7.1.3

classpath 'com.android.tools.build:gradle:7.1.3'

Upgrading the kotlin-gradle-plugin version to 1.5.20 resolved the issue for me.

Related