Flutter报错Error: Attribute application@name at AndroidManifest.xml:5:9-42 requires a placeholder s...

今天在集成jpush-flutter之后,运行工程到安卓模拟器的时候报错:

Error:Attribute application@name at AndroidManifest.xml:5:9-42 requires a placeholder substitution but no value for  is provided.

,在网上搜索后都说要在android/app下的build.gradle文件android {}中的defaultConfig {}中添加

manifestPlaceholders += [appAuthRedirectScheme:"com.example.multi_delivery_app",  
  applicationName: "com.example.multi_delivery_app.Application"]

可是添加后依旧报错,后找到一个解决了我的问题的方法,还是在这个文件中,在buildTypes {}中添加如下代码:

buildTypes {
        release {
            manifestPlaceholders = [applicationName: "android.app.Application"]
        }

        debug {
            manifestPlaceholders = [applicationName: "android.app.Application"]
        }

        build {
            manifestPlaceholders = [applicationName: "android.app.Application"]
        }
    }

之后运行,成功启动!

你可能感兴趣的:(Flutter报错Error: Attribute application@name at AndroidManifest.xml:5:9-42 requires a placeholder s...)