ionic3错误com.google.android.gms:play-services-measurement-base由[[16.5.0,16.5.0],[16.4.0,16.4.0]]上的其他库提供?

时间:2019-05-07 10:42:53

标签: ionic3 google-play-services

每次尝试此操作时,离子cordova运行android之后,我都遇到了以上错误:

  

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck   = true

在build.gradle

将google服务版本降级到3.2.1

  

classpath'com.google.gms:google-services:3.2.1'

在build.gradle的底部,可以添加以下内容来解决该问题:

  

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck   = true

但是对我没有任何帮助,请告诉我如何解决?

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' } // Fabrics Maven repository from cordova-plugin-firebase
        maven {
            url "https://maven.google.com"
        }
    }

    // Switch the Android Gradle plugin version requirement depending on the
    // installed version of Gradle. This dependency is documented at
    // http://tools.android.com/tech-docs/new-build-system/version-compatibility
    // and https://issues.apache.org/jira/browse/CB-8143
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:4.1.0' // google-services dependency from cordova-plugin-firebase
        classpath 'io.fabric.tools:gradle:1.25.4' // fabric dependency from cordova-plugin-firebase
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: "CordovaLib"))
    compile "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
    compile "com.android.support:support-v4:24.1.1+"
    compile "com.android.support:support-v4:27+"
    compile "com.android.support:support-v4:25.+"
    compile "com.android.support:appcompat-v7:25.+"
    compile "com.google.android.gms:play-services-tagmanager:+"
    compile "com.google.firebase:firebase-core:+"
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.google.firebase:firebase-config:+"
    compile "com.google.firebase:firebase-perf:+"
    compile "com.google.android.gms:play-services-maps:15.0.1"
    compile "com.google.android.gms:play-services-location:15.0.1"
    compile "com.android.support:support-core-utils:27.+"
    compile "com.google.android.gms:play-services-location:11+"
    compile "com.android.support:support-v4:26+"
    compile "com.android.support:appcompat-v7:26+"
    compile "com.google.android.gms:play-services-location:15.+"
    compile "com.android.support:appcompat-v7:23+"
    compile "com.android.support:support-v4:26.+"
    compile "com.android.support:appcompat-v7:26.+"
    // SUB-PROJECT DEPENDENCIES END
}

project.properties
  target=android-26
  android.library.reference.1=CordovaLib
  cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
  cordova.system.library.2=com.android.support:support-v4:24.1.1+
  cordova.system.library.3=com.android.support:support-v4:27+
  cordova.system.library.4=com.android.support:support-v4:25.+
  cordova.system.library.5=com.android.support:appcompat-v7:25.+
  cordova.gradle.include.1=cordova-plugin-firebase/managment-build.gradle
  cordova.system.library.6=com.google.firebase:firebase-core:16.0.8
  cordova.system.library.7=com.google.firebase:firebase-messaging:17.6.0
  cordova.system.library.8=com.google.firebase:firebase-config:16.5.0
  cordova.system.library.9=com.google.firebase:firebase-perf:16.2.5
  cordova.gradle.include.2=cordova-plugin-googlemaps/managment-tbxml-android.gradle
  cordova.system.library.11=com.google.android.gms:play-services-maps:15.0.1
  cordova.system.library.12=com.google.android.gms:play-services-location:15.0.1
  cordova.system.library.13=com.android.support:support-core-utils:27.+
  cordova.system.library.14=com.google.android.gms:play-services-location:11+
  cordova.system.library.15=com.android.support:support-v4:26+
  cordova.system.library.16=com.android.support:appcompat-v7:26+
  cordova.gradle.include.3=cordova-plugin-mauron85-background-geolocation/managment-dependencies.gradle
  cordova.system.library.17=com.google.android.gms:play-services-location:15.+
  cordova.system.library.18=com.android.support:appcompat-v7:23+
  cordova.gradle.include.4=cordova-plugin-telerik-imagepicker/managment-ignorelinterrors.gradle
  cordova.gradle.include.5=cordova-plugin-telerik-imagepicker/managment-androidtarget.gradle
  cordova.system.library.19=com.android.support:support-v4:26.+
  cordova.system.library.20=com.android.support:appcompat-v7:26.+

1 个答案:

答案 0 :(得分:0)

只需更改

  

platforms / android / project.properties

对于出现问题的插件,您应该指定目标版本而不是 + ,在我的情况下是Firebase,因此以下是我的更改:

更早

# Project target.
target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-firebase/affeedback-build.gradle
cordova.system.library.1=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.2=com.google.firebase:firebase-core:+
cordova.system.library.3=com.google.firebase:firebase-messaging:+
cordova.system.library.4=com.google.firebase:firebase-config:+
cordova.system.library.5=com.google.firebase:firebase-perf:+
cordova.system.library.6=com.android.support:support-annotations:27.+

现在

# Project target.
target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.android.support:support-v4:23.2.1
cordova.system.library.2=com.google.code.gson:gson:2.3
cordova.system.library.3=commons-io:commons-io:2.4
cordova.system.library.4=com.android.support:support-v4:24.1.1+
cordova.gradle.include.1=cordova-plugin-firebase/fmauser-build.gradle
cordova.system.library.5=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.6=com.google.firebase:firebase-core:16.0.8
cordova.system.library.7=com.google.firebase:firebase-messaging:17.6.0
cordova.system.library.8=com.google.firebase:firebase-config:16.5.0
cordova.system.library.9=com.google.firebase:firebase-perf:16.2.5
cordova.system.library.10=com.android.support:support-annotations:27.+
cordova.gradle.include.2=cordova-support-google-services/fmauser-build.gradle
cordova.system.library.11=com.android.support:support-v4:27.+
cordova.gradle.include.3=phonegap-plugin-barcodescanner/fmauser-barcodescanner.gradle
cordova.gradle.include.4=cordova-android-support-gradle-release/fmauser-cordova-android-support-gradle-release.gradle

请使用以下发行说明查看每个插件的确切版本。 link1link2link3

希望这会有所帮助!