【问题标题】:Flutter app bundle build error: "Could not find method keyAlias() for arguments"Flutter 应用程序包构建错误:“找不到参数的方法 keyAlias()”
【发布时间】:2021-06-18 07:46:05
【问题描述】:

我正在尝试在 Google Play 商店中设置 Flutter 应用程序的测试发布版本,但在构建应用程序包时,我在 build.gradle 文件中收到错误 Could not find method keyAlias() for arguments。发生错误的/android/app/build.gradle 文件的相关部分如下所示:

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

// ...

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

key.properties 文件是:

storePassword=<some password here>
keyPassword=<another password here>
keyAlias=<some alias here>
storeFile=<absolute path to the key store>

有什么想法吗?

【问题讨论】:

    标签: flutter google-play-console


    【解决方案1】:

    好吧,没关系。我找到了错误的根源,我会在这里回答我的问题,因为我认为这是一个任何菜鸟都可能掉入的陷阱。

    错误的来源是定义 keyAlias 的行末尾的逗号。

    错误消息完全具有误导性。

    【讨论】:

      猜你喜欢
      • 2020-10-25
      • 2020-01-04
      • 2020-01-18
      • 2021-12-14
      • 1970-01-01
      • 2021-07-05
      • 2021-12-11
      • 2020-03-30
      • 1970-01-01
      相关资源
      最近更新 更多