添加后出现编译错误CardView and 回收视图依赖关系,我检查了每一篇文章,但似乎没有人解决这个问题。
Error:
错误:任务“:app:processDebugManifest”执行失败。清单合并失败:属性元数据#android.support.VERSION@value value=(25.3.1) 来自 [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
也存在于 [com.android.support:cardview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1) 中。
建议:将 'tools:replace="android:value"' 添加到 AndroidManifest.xml:25:5-27:34 的元素中进行覆盖。
我的构建.Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.soft.kukito.cardviewprueba"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
}
谢谢大家的回答。
您需要使用相同的 android 支持库版本。您需要使用支持库26.0.0-alpha1
版本。因此更改以下内容:
compile 'com.android.support:appcompat-v7:25.3.1'
to
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
您还需要更改compileSdkVersion
and targetSdkVersion
到版本26.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)