我的构建失败并出现此错误 - list 合并因多个错误而失败,请参阅日志
合并错误显示为 -
错误:AndroidManifest.xml:23:9-51 应用程序主 list (此文件)第 22 行中的元素元数据缺少“名称”关键属性 错误:工具:在第 23 行为属性 android:value 指定的替换,但未指定新值应用程序主 list (此文件),第 22 行 错误:验证失败,退出应用程序主 list (此文件)
AndroidManifest.xml - 下面是 list 文件中显示错误的一小段。
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data tools:replace="android:value"/>
<activity ....
Build.Gradle 文件小段如下 -
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.5'
testImplementation 'junit:junit:4.12'
}
最佳答案
删除这个:
<meta-data tools:replace="android:value"/>
它似乎没有做任何事情,这是导致您出错的原因。
关于android - 升级到 Android Studio 3.2.1 后出现构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53583538/