与SDK版本的Android同步问题



我正在开发一个Android应用程序,并且我在应用程序中使用'Firebase-Message'库。现在,我需要" proguard",不幸的是," firebase"产生了错误。我搜索了解决方案,然后将" buildToolversion"版本25.0.0更改为26.0.2。当我更改版本时,我会收到以下错误。我尝试了互联网上的许多解决方案,包括" firebase github"本身,但没有好处。我正在使用" firebase-messaging 12.0.1"及以下是我遇到的错误。

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:design:26.0.2] AndroidManifest.xml:28:13-35
    is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.

build.gradle(project(

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.2.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.google.com' }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(模块(

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.sample.firebase"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:design:26.0.2'
    compile 'com.android.support:appcompat-v7:26.0.0'
    compile 'com.jakewharton:butterknife:5.1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'de.hdodenhof:circleimageview:2.2.0'
    compile 'me.angrybyte.goose:goose:1.8.0'
    compile 'com.flaviofaria:kenburnsview:1.0.7'
    compile 'com.google.firebase:firebase-messaging:12.0.1'
    compile 'com.google.firebase:firebase-core:12.0.1'
    compile 'com.jpardogo.googleprogressbar:library:1.2.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

您需要更改以下代码线:

compile 'com.android.support:appcompat-v7:26.0.0'

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

所有依赖性都必须是同一版本。

相关内容

  • 没有找到相关文章

最新更新