Flutter 编译时报错 no value for applicationName is provid

221 阅读1分钟

flutter 在Android上运行时编译报错:

main\AndroidManifest.xml:12:9-42 Error:
Attribute application@name at AndroidManifest.xml:12:9-42 requires a 
placeholder substitution but no value for <applicationName> is provided.

这种情况一般是在 build.gradle 中使用了 manifestPlaceholders

defaultConfig {

minSdkVersion 24
targetSdkVersion 33

manifestPlaceholders = [...]
}

只需要在 AndroidManifest.xmlapplication 标签中去掉 一下代码就行

android:name="${applicationName}"