Skip to content

[Question] application id not match with the id config in the corresponding env file #64

@thaiquoctoanvn

Description

@thaiquoctoanvn

I have my .env like this

APP_NAME=DEV
APP_ID=au.com.myapp.dev

and my env.production like this

APP_NAME=PRO
APP_ID=au.com.myapp.pro

When I run the command flutter build apk --release on Android device I got the application id is au.com.myapp.dev but the app name is PRO. Can any help me explain what is the problem? Ii expect that the application id would be au.com.myapp.pro
My config in gradle likes this

apply from: project(':flutter_config').projectDir.getPath() + "/dotenv.gradle"
project.ext.envConfigFiles = [
        staging: ".env.staging",
        release: ".env.production",
        anothercustombuild: ".env",
]
android {
defaultConfig {
        applicationId project.env.get("APP_ID")
        versionCode project.env.get("VER_CODE").toInteger()
        versionName project.env.get("VER_NAME")
        minSdkVersion 24
        targetSdkVersion flutter.targetSdkVersion
        resValue "string", "build_config_package", "com.example.electronic_vhc"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions