【问题标题】:build flutter with different flavors构建不同风味的颤振
【发布时间】:2020-10-27 12:58:10
【问题描述】:

我试图在不同的环境中构建我的应用程序,所以我关注了this tutorialthis video,当我运行 Flutter 正常运行时,一切正常,但是当我尝试构建时出现此错误:

所以我忘了添加一些口味,然后我在我的 build.gradle (android/app/build.gradle) 中添加了这个:

android {
    compileSdkVersion 29

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "secret-domain"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

    flavorDimensions "app"
    productFlavors {
        dev {
            dimension "app"
            applicationIdSuffix ".dev"
        }
        prod {
            dimension "app"
            applicationIdSuffix ".prod"
        }
        hml {
            dimension "app"
            applicationIdSuffix ".hml"
        }
    }
}

又遇到了这个错误:

【问题讨论】:

标签: android flutter android-build-flavors


【解决方案1】:

作为R.Shpd 的补充,我的问题是我之前的另一个开发人员已经配置了构建,将 key.properties 放在 gitignore 中,所以 buildgradle 永远找不到文件

【讨论】:

    猜你喜欢
    • 2014-07-05
    • 2023-04-03
    • 1970-01-01
    • 2020-08-25
    • 2020-12-18
    • 2021-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多