You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter打包appbundle报错:评估项目':app'时无匹配android()方法签名

错误原因

Gradle解析android/app/build.gradle的android配置块失败,根源是你在signingConfigs子块中错误写入了仅属于defaultConfig的配置字段,不符合Gradle Android插件的配置语法规范,所以触发了方法签名不匹配的报错:

评估项目':app'时发生问题。
No signature of method: build_bobankfptw27tkl4q05osmwsd.android() is applicable for argument types: (build_bobankfptw27tkl4q05osmwsd$_run_closure2) values: [build_bobankfptw27tkl4q05osmwsd$_run_closure2@103337d8]

解决方案
  • 定位到android/app/build.gradle文件中的signingConfigs代码块
  • 删除signingConfigs块内的冗余配置,这些配置你已经在上方defaultConfig中定义过,不允许出现在signingConfigs作用域下:
applicationId "fr.mediprest"
minSdkVersion 18
targetSdkVersion 30
compileSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
  • 修正后的signingConfigs块仅保留签名相关配置即可:
signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
        storePassword keystoreProperties['storePassword']
    }
}
  • 保存修改后,先执行flutter clean清理本地构建缓存,再重新执行flutter build appbundle即可完成构建。

内容的提问来源于stack exchange,提问作者Florian Sorin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.30 12:36:03