gradle not recognizing local modules after adding product flavors to my android app

44 views Asked by At

I have a multi-module app with 2 product flavors. I'm trying to specify the local modules that should be included in one flavor, but not another. Here's my :app module's build.gradle file:

plugins {
    alias libs.plugins.android.application
    alias libs.plugins.kotlin.android
    id 'kotlin-kapt'
    alias libs.plugins.android.hilt
}

android {
    namespace 'com.salmakhd.android.fibo'
    compileSdk 34

    defaultConfig {
        applicationId "com.salmakhd.android.fibo"
        minSdk 23
        targetSdk 33
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary true
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug
            applicationIdSuffix ".release"
        }
        benchmark {
            initWith buildTypes.release
            minifyEnabled true
            signingConfig signingConfigs.debug
            matchingFallbacks = ['release']
            debuggable false
        }
    }

    compileOptions {
        coreLibraryDesugaringEnabled true
        // determines available syntax features
        sourceCompatibility JavaVersion.VERSION_1_8
        // determines available JVMs that can run the byte code
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    buildFeatures {
        buildConfig true
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion compose_compiler_version
    }

    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }

    flavorDimensions 'user'
    productFlavors {
        general {
            dimension 'user'
            applicationIdSuffix '.general'
            versionNameSuffix '-general'
            minSdk 23
            signingConfig signingConfigs.debug
            proguardFiles 'proguard-rules.pro'
        }
        coach {
            dimension 'user'
            applicationIdSuffix '.coach'
            versionNameSuffix '-coach'
            targetSdk 33
            minSdk 23
            signingConfig signingConfigs.debug
            proguardFiles 'proguard-rules.pro'
        }
    }
}

dependencies {
    coachImplementation project(":core:data")
    coachImplementation project(":screen:authentication")
    implementation project(path: ':core:analytics')
.
.
.
}

but it keeps saying "Unrecognized Dependency notation" for all the three dependencies shown. What might be the problem? The documentation follows the exact same structure (https://developer.android.com/build/build-variants#dependencies). I'm using gradle 8.4

0

There are 0 answers