解决: Attribute meta-data#package_name@value at AndroidManifest.xml:23:13-44 requires a placeholder 错误

完整版错误信息:

Merging Errors: Error: Attribute meta-data#package_name@value at AndroidManifest.xml:23:13-44 requires a placeholder substitution but no value for is provided. app main manifest (this file), line 22 Error: Validation failed, exiting app main manifest (this file)

意思就是:AndroidManifest.xml里面的meta-data没有未提供的值

项目的配置情况:

1.config.gradle (自己新建的一个gradle,用于配置项目的某些公共信息)

ext {
    manifestPlaceholders = [
            "package_name"         : 'com.example.myapplication',
            …………………………………………………………………………………………………………………………………………
    ]
}

2. 项目的build.gradle(Project:My Application)头部增加:

apply from: "config.gradle"

 3.AndroidManifest.xml(有写或者没有写)


解决:

1.主工程build.gradle(Module:app)增加(注意名字要对应上):

android {
    …………………………………………
    defaultConfig {
        manifestPlaceholders = [
               package_name     : rootProject.ext.manifestPlaceholders.package_name
        ]
    }
}

2.修改的赋值(注意名字要对应上):


 

 

你可能感兴趣的:(Bug填坑笔记)