在构建

时间:2017-12-05 11:48:04

标签: android android-gradle android-room

我试图在我的android项目中升级android.arch.persistence.room。

现在我使用alpha-9并且一切正常。 如果我尝试使用"发布"版本1.0.0我将在 compile' com.android.support:appcompat-v7:26.0.2' 一行中回复下面报告的错误。

  

错误:任务':app:processDebugManifest'执行失败。   清单合并失败:来自[com.android.support:design:26.0.2]的属性meta-data#android.support.VERSION@value value =(26.0.2)AndroidManifest.xml:28:13-35       也出现在[com.android.support:support-core-utils:26.1.0] AndroidManifest.xml:28:13-35 value =(26.1.0)。       建议:添加'工具:replace =" android:value"'到AndroidManifest.xml:26:9-28:38的元素覆盖。

gradle文件是



apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            useLibrary 'org.apache.http.legacy'
        }
    }
}
dependencies {
    debugCompile 'com.amitshekhar.android:debug-db:1.0.1'
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.android.support:design:26.0.2'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.android.support:support-v4:26.0.2'
    compile 'com.journeyapps:zxing-android-embedded:3.5.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'android.arch.persistence.room:runtime:1.0.0'
    annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
}




有人知道如何解决它吗?

由于

2 个答案:

答案 0 :(得分:1)

变化:

compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-v4:26.0.2'

为:

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'

答案 1 :(得分:0)

查看以下版本的更改是否适合您:

(archLifecycleVersion = '1.0.0'
roomLifecycleVersion = '1.0.0')



annotationProcessor "android.arch.lifecycle:compiler:$rootProject.ext.archLifecycleVersion"
compile "android.arch.lifecycle:runtime:$rootProject.ext.archLifecycleVersion"
compile "android.arch.lifecycle:extensions:$rootProject.ext.archLifecycleVersion"

compile "android.arch.persistence.room:runtime:$rootProject.roomLifecycleVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomLifecycleVersion"