I have an issue: when the app has multiple flavors...
# compose-wear
l
I have an issue: when the app has multiple flavors: dev, stag, production. Not on wear. Currently it matches applicationID for both app and watch. I can’t send data between the app and the wear app. Link same issue: https://stackoverflow.com/questions/28034315/android-wear-sending-data-to-android-phone-but-phone-appears-to-never-receive-i/32707248#32707248 Project : compose wear.
not kotlin but kotlin colored 2
with project: https://github.com/buiduclam09/everfit-watch: It’s okay. with project having flavor doesn’t seem to work.
m
did you check in build.gradle for configuring the same flavors in the watch app module?
l
i checked it, it match.
Copy code
android {
    namespace "com.everfit"
    compileSdk 34
    publishNonDefault true

    defaultConfig {
        applicationId "com.everfit"
        minSdk 30
        targetSdk 34
        versionCode 1
        versionName "1.0"
        vectorDrawables {
            useSupportLibrary true
        }
        flavorDimensions "debug"
    }

    productFlavors {
        MainApp {
            applicationId "com.everfit"
        }
    }
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '<http://proguard-rules.pro|proguard-rules.pro>'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion '1.3.2'
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
}
configurations {
    mainAppDebug
    mainAppRelease
}
dependencies {
    implementation fileTree(dir: 'libs', include: '*.aar')
    mainAppDebug project(path: ':everfit-wear', configuration: 'MainAppDebug')
    mainAppRelease project(path: ':everfit-wear', configuration: 'MainAppRelease')
}
Copy code
android {
    productFlavors {
        MainApp {
            applicationId = "com.everfit"
            versionName "3.20.1"
            versionCode 3046
            buildConfigField "boolean", "IS_WHITE_LABEL", "false"
        }
defaultConfig {
        minSdkVersion 23
        targetSdkVersion android_target_sdk_version
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
        flavorDimensions "debug"
    }
buildTypes {
        debug {
            applicationIdSuffix '.debug'
            multiDexKeepFile file('multidex-config.txt')
            resValue "string", "app_name", "@string/app_name_debug"
   mappingFileUploadEnabled false
            }
        }
Copy code
}

        release {
        }
Fixed issue. Thank you everyone.