Еще один конфликт версий между Firebase и Play-Services: com.google.android.gms: play-services-measure-base - PullRequest
0 голосов
/ 12 сентября 2018

Мое приложение использует части сервисов Google Play и Firebase, и я хочу реализовать функцию обмена сообщениями в приложении Firebase. У меня есть google-services плагин v4.1.0, и связанные с ним зависимости в моем файле Gradle уровня приложения выглядят так:

implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-analytics:16.0.3"
implementation "com.google.android.gms:play-services-ads:15.0.1"
implementation "com.google.android.gms:play-services-auth:16.0.0"
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.1' //this error only popped up when I added this line
implementation 'com.google.firebase:firebase-messaging:17.3.1'
implementation "com.google.firebase:firebase-core:16.0.3"
implementation "com.google.firebase:firebase-auth:16.0.3"
implementation "com.google.firebase:firebase-database:16.0.2"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation "com.google.firebase:firebase-appindexing:16.0.1"

При попытке создать приложение я получил следующую ошибку:

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4], [16.0.2,16.0.2]], but resolves to 16.0.2.

Я знаю некоторые другие вопросы и документацию Firebase, в которой говорится, что я должен обновить все функции Firebase и Play Services до их последних версий, но это последние. Я проверил в официальной документации обоих.

16.0.2 соответствует только зависимости firebase-database, так что это как-то связано с этим? Или это что-то еще (отсутствует или нуждается в обновлениях)?

РЕДАКТИРОВАТЬ: В соответствии с просьбой, мой файл Gradle уровня проекта:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "https://maven.google.com"
        }
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:4.1.0' // google-services plugin
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            //url "https://jitpack.io"
            url "https://maven.google.com"
        }
        flatDir {
            dirs 'libs'
        }
    }
}

И мой app файл Gradle уровня модуля:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        mavenCentral()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    jcenter()
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    google()
}

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.picmix.mobile"
        minSdkVersion 15
        targetSdkVersion 27
        multiDexEnabled true
        buildConfigField "String", "EMBED", "\"\""

        versionCode 90      //Latest Version on Google Play
        versionName "7.7.8"

        packagingOptions{
            doNotStrip '*/mips/*.so'
            doNotStrip '*/mips64/*.so'
        }

        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86"
        }
    }

    signingConfigs {
        release {
            storeFile file("/Volumes/work/cert/android/picmix_key")
            storePassword "P1cMIx_M0B1l3_#2012#"
            keyAlias "picmix"
            keyPassword "P1cMIx_M0B1l3_#2012#"
        }
    }

    flavorDimensions "default"
    productFlavors {
        dev {
            minSdkVersion 21
            versionCode 1
            versionName "1.0"
        }

        dev2 {
            minSdkVersion 15
            versionCode 1
            versionName "1.0"
        }

        preload {
            buildConfigField "String", "EMBED", "\"huawei\""
        }

        prod {
            minSdkVersion 15
        }

        andgo {
            minSdkVersion 15
            versionCode 50000  + android.defaultConfig.versionCode
        }
//        lintOptions {
//            checkReleaseBuilds false
//        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            debuggable false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            //minifyEnabled true //Normally THIS SHOULDN'T BE HERE
            debuggable true
            //shrinkResources true
            //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' //Normally THIS SHOULDN'T BE HERE
        }
    }

    dexOptions {
        javaMaxHeapSize "2g"
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

    /*
    defaultConfig {
        renderscriptTargetApi 21
        renderscriptSupportModeEnabled true
        renderscriptSupportModeBlasEnabled true
    }
    */
}

ext {
    supportLibVersion = '27.1.1';
    gmsVersion = '15.0.0';
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/libadapterinmobi.jar')
//    implementation project(':volley')
    //debugimplementation project(path: ':PG_Edit_SDK', configuration: 'debug')
    //releaseimplementation project(path: ':PG_Edit_SDK', configuration: 'release')

    //implementation('com.twitter.sdk.android:twitter-core:1.7.0@aar') {
    //    transitive = true;
    //}
    implementation 'com.twitter.sdk.android:twitter-core:3.0.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }

    //implementation files('libs/InMobi-6.2.3.jar')
    //implementation files('libs/adcolony.jar')
    //implementation files('libs/dagger-2.7.jar')
    //implementation files('libs/javax.inject-1.jar')
    //implementation files('libs/vungle-publisher-adaptive-id-4.0.3.jar')
    //implementation(name: 'AudienceNetwork', ext: "aar")
    //implementation(name: 'PokktSDK_v6.0', ext: "aar")
    //implementation(name: 'unity-ads', ext: "aar")
    //implementation 'com.vmax.android.ads.aar:vmax@aar'
    implementation "com.android.support:appcompat-v7:$supportLibVersion"
    implementation "com.android.support:customtabs:$supportLibVersion"
    implementation "com.android.support:design:$supportLibVersion"
    implementation "com.android.support:cardview-v7:$supportLibVersion"
    implementation "com.android.support:recyclerview-v7:$supportLibVersion"
    implementation "com.android.support:palette-v7:$supportLibVersion"
    implementation "com.android.support:support-v4:$supportLibVersion"

    implementation "com.google.android.gms:play-services-location:15.0.1"
    implementation "com.google.android.gms:play-services-analytics:16.0.3"
    implementation "com.google.android.gms:play-services-ads:15.0.1"
    implementation "com.google.android.gms:play-services-auth:16.0.0"
    implementation "com.google.firebase:firebase-core:16.0.3"
    implementation "com.google.firebase:firebase-messaging:17.3.1"
    implementation "com.google.firebase:firebase-auth:16.0.3"
    implementation "com.google.firebase:firebase-database:16.0.2"
    implementation "com.google.firebase:firebase-appindexing:16.0.1"
    implementation "com.google.android.gms:play-services-measurement-base:16.0.2"
    implementation "com.google.firebase:firebase-config:16.0.0"
    implementation "com.google.firebase:firebase-inappmessaging-display:17.0.1"

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
    implementation 'com.melnykov:floatingactionbutton:1.3.0'
    implementation 'com.googlecode.mp4parser:isoparser:1.1.22'
    implementation 'me.relex:circleindicator:1.2.1@aar'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.github.bumptech.glide:volley-integration:1.5.0@aar'
    implementation 'com.squareup.okhttp3:okhttp:3.5.0'
    implementation 'com.mixpanel.android:mixpanel-android:4.9.8'
    implementation 'com.flurry.android:analytics:6.4.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
    implementation 'com.danikula:videocache:2.7.0'
    //implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'

    implementation 'com.inmobi.monetization:inmobi-ads:7.0.2'

    implementation group: 'commons-io', name: 'commons-io', version: '2.5'
}

apply plugin: 'com.google.gms.google-services'
...