清单合并失败,编译时出错 [英] Manifest merger failed, error on compiling
问题描述
由于下载了最新的SDK并安装了Android Studio,因此我的项目无法构建. 我收到以下消息:
Since downloading the latest SDK and installing Android Studio, my project fails to build. I get the following message:
清单合并失败,并出现多个错误
Manifest merger failed with multiple errors
我的gradle应用:
My gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.app.clupascu.oavm"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.github.chrisbanes:PhotoView:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.app.clupascu.oavm">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:appComponentFactory">
<activity
android:name=".MainPage"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".FirstObchodni"
android:label="@string/obchodn_akademie"/>
<activity android:name=".SecondObchodni"
android:label="@string/_2_obchodn_akademie"/>
<activity android:name=".VysiiOdborna"
android:label="@string/_3_vy_odborn_kola"/>
</application>
</manifest>
在合并清单中这样写:
Merging Errors: Error: tools:replace specified at line:6 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 5 Error: Validation failed, exiting app main manifest (this file)
我尝试了其他问题的很多解决方案,但没有结果,非常感谢.
I tried a lot of solutions from other questions, but without result, Thanks a lot.
推荐答案
"tools:replace =" android:appComponentFactory<-这行是您对清单合并所说的,您将为android提供新的价值:appComponentFactory属性,但您没有这样做.因此,据我所知,您有两个选择:
"tools:replace="android:appComponentFactory" <- this line you're saying to Manifest merger that you're going to provide new value for android:appComponentFactory attribute but you're not doing so. So as I see it you have two options:
-
删除工具:replace ="android:appComponentFactory"
Remove tools:replace="android:appComponentFactory"
为android:appComponentFactory属性提供新值
Provide new value for android:appComponentFactory" attribute
希望有帮助.
这篇关于清单合并失败,编译时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!