Androidの依存関係「com.google.android.gms:プレイサービス - 統計は、」さまざまなコンパイルのバージョン(16.0.1)とランタイム(17.0.0)クラスパスを持っています

ヨリス:

昨日私のアプリは、正しく構築された、今日私はもう築くことができないんだけど、何も変更せずに、私はこのエラーを取得しています:

Androidの依存関係「com.google.android.gms:プレイサービス - 統計は、」>コンパイル(16.0.1)とランタイム(17.0.0)>クラスパスのための別のバージョンがあります。手動で> DependencyResolutionを経由して、同じバージョンを設定する必要があります

私は「com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheckが真=」とプロジェクトを何度も掃除が、エラーがまだここにいると、このバイパスしようとしました。

マイアプリ/ build.gradleファイル:

apply plugin: "com.android.application"
apply plugin: "com.android.application"
apply plugin: "io.fabric"

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.yapero"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        multiDexEnabled true
        versionCode 743
        versionName "1.74"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
        versionNameSuffix '3'
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    packagingOptions {
        exclude 'META-INF/main.kotlin_module'
        exclude 'META-INF/-no-jdk.kotlin_module'
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation project(':@segment_analytics-react-native')
    implementation project(':react-native-webview')
    implementation project(':react-native-version-check')
    implementation project(':react-native-firebase')
    implementation(project(':react-native-firebase')) {   
       transitive = false
   }
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {transitive = true}
    //implementation project(':react-native-version-check')
    implementation project(':react-native-maps')
    implementation project(':react-native-intercom')
    implementation 'io.intercom.android:intercom-sdk-base:5.+'
    implementation 'io.intercom.android:intercom-sdk-fcm:5.+'
    implementation project(':react-native-fbsdk')
    implementation project(':react-native-device-info')
    implementation project(':react-native-appsflyer')
    implementation project(':react-native-text-input-reset')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-fast-image')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "com.google.android.gms:play-services-base:16.1.0"
    implementation "com.google.firebase:firebase-core:16.0.8"
    implementation "com.google.firebase:firebase-auth:16.2.1"
    implementation "com.google.firebase:firebase-firestore:17.1.5"
    implementation "com.google.firebase:firebase-messaging:17.5.0"
    implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
    implementation 'com.android.support:multidex:1.0.0'
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

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

私のbuild.gradle:

buildscript {
    ext {
        buildToolsVersion = "28.0.2"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.25.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.7'
    distributionUrl = distributionUrl.replace("bin", "all")
}

誰かのノウハウが正しいか、このバージョンチェックのバイパスにどのようにしていますか?あなたはより多くの情報が必要な場合は掲載していません。

ローラン・S:

githubの上のこのコメントは、あなたの質問(と私)への答えを提供します。

(依存react-native-device-infoこの場合は)その依存関係の1つの代わりに、固定/固定バージョンの最新バージョンを使用していました。Googleサービスの新バージョンがされた場合には、昨日リリースされ、それがために新しいバージョンにプルにビルドを引き起こしdevice-info、それによって、正しく、彼らが必要とするバージョンをピン他の依存関係との競合を引き起こし、。

ソリューションは、あなたの中にリンクの記事で説明されているものを行うことですandroid/app/build.gradle

implementation(project(":react-native-device-info"),  {
  exclude group: "com.google.android.gms"
})
implementation "com.google.android.gms:play-services-gcm:16.0.0"

おそらく置き換えるreact-native-device-info同じ問題を抱えていることがあり、他の依存関係(彼らは次のような行含まれるであろうとimplementation "com.google.android.gms:play-services-gcm:+"、GoogleのGCMの最新バージョンである何に依存するが)。

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=225987&siteId=1