【发布时间】:2019-08-11 14:23:37
【问题描述】:
当我添加两个 (1.2.) 依赖项时,我得到 Manifest merger failed error.
依赖提示如下:
- 实现 'com.karumi:dexter:5.0.0'
- 实施 'com.google.android.gms:play-services-maps:17.0.0'
我正在使用 android studio 3.4.1 + gradle 版本 5.1.1
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.houselocation"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.karumi:dexter:5.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
}
所有 com.android.support 库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃)。成立 版本 28.0.0、27.1.1。例子包括 com.android.support:animated-vector-drawable:28.0.0 和 com.android.support:design:27.1.1 less... (Ctrl+F1) 检查 信息:有一些库的组合,或者工具和库, 不兼容或可能导致错误。一种这样的不兼容 正在编译的 Android 支持库版本是 不是最新版本(或者特别是低于您的版本 targetSdkVersion)。问题 ID:GradleCompatible
使用 groupId com.android.support 和 androidx.* 的依赖项不能 合而为一 IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='support-vector-drawable', myVersion='28.0.0', myPacking='aar', myClassifier='null'} 和 IdeMavenCoordinates{myGroupId='androidx.cursoradapter', myArtifactId='cursoradapter', myVersion='1.0.0', myPacking='aar', myClassifier='null'} 不兼容的依赖少... (Ctrl+F1) 检查信息:有一些库或工具的组合和 不兼容或可能导致错误的库。一个这样的 不兼容正在编译一个版本的 Android 支持 不是最新版本的库(或者特别是版本 低于你的 targetSdkVersion)。问题 ID:GradleCompatible
和 Gradle 同步问题
错误:清单合并失败:属性 应用程序@appComponentFactory 值=(android.support.v4.app.CoreComponentFactory)来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 也出现在 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 值=(androidx.core.app.CoreComponentFactory)。建议:加 'tools:replace="android:appComponentFactory"' 到元素 在 AndroidManifest.xml:5:5-19:19 处进行覆盖。
【问题讨论】:
标签: android-studio dependencies