首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >play-services-measurement的问题

play-services-measurement的问题
EN

Stack Overflow用户
提问于 2019-05-07 11:00:08
回答 11查看 17.9K关注 0票数 55

我有一个关于离子项目的问题,它昨天开始发生,没有修改任何依赖项。

当我运行ionic cordova run android时,我得到了这个错误:

代码语言:javascript
复制
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

但这些天我没有安装任何依赖项。

这是我的cordova plugins列表:

代码语言:javascript
复制
cordova-fabric-plugin 1.1.14-dev "cordova-fabric-plugin"
cordova-plugin-advanced-http 2.0.9 "Advanced HTTP plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appminimize 1.0.1 "AppMinimize"
cordova-plugin-apprate 1.4.0 "AppRate"
cordova-plugin-appsee 2.6.0 "Appsee"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-facebook4 3.2.0 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-freshchat 1.2.0 "Freshchat plugin for Phonegap"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-inapppurchase-fixed 1.1.0 "In App Purchase"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-media 5.0.2 "Media"
cordova-plugin-nativegeocoder 3.2.2 "NativeGeocoder"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.4 "SocialSharing"
cordova-support-google-services 1.2.1 "cordova-support-google-services"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-deeplinks 1.0.19 "Ionic Deeplink Plugin"
nl.kingsquare.cordova.background-audio 1.0.1 "background-audio"
pushwoosh-cordova-plugin 7.13.0 "Pushwoosh"

我在我的platforms/android/app/build.gradle中发现了以下依赖项(如果很高兴知道的话):

代码语言:javascript
复制
dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: ":CordovaLib"))
    compile "com.android.support:support-v4:24.1.1+"
    compile "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
    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.android.support:support-v4:26.+"
    compile "com.android.support:support-v4:27.+"
    compile "com.android.support:appcompat-v7:27.+"
    compile "com.android.support:recyclerview-v7:27.+"
    compile "com.android.support:design:27.+"
    compile "com.android.support.constraint:constraint-layout:1.0.2"
    compile "com.github.bumptech.glide:glide:4.7.1"
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"
    compile "com.pushwoosh:pushwoosh:5.13.0"
    compile "com.pushwoosh:pushwoosh-amazon:5.13.0"
    compile "com.pushwoosh:pushwoosh-badge:5.13.0"
    compile "com.pushwoosh:pushwoosh-inbox:5.13.0"
    compile "com.pushwoosh:pushwoosh-inbox-ui:5.13.0"
    compile "com.facebook.android:facebook-android-sdk:4.38.1"
    compile "com.appsee:appsee-android:2.6.0"
    // SUB-PROJECT DEPENDENCIES END
}

我不知道该去哪里找。我发现了一个解决方法,在platforms/android/build.gradle making:com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true中禁用了GoogleServicesPlugin的版本检查,但它对我不起作用。

提前谢谢。

编辑:看起来我不是唯一的一个。Here

EN

回答 11

Stack Overflow用户

回答已采纳

发布于 2019-05-08 01:56:07

在这里发布的解决方案对我来说都不起作用。一个很棒的人在cordova-firebase-plugin官方资源库中打开了一个pull request,它可以正常工作。

我所做的步骤:

1-使用ionic cordova plugin remove cordova-plugin-firebase删除cordova-firebase-plugin

2-安装:ionic cordova plugin add cordova-plugin-firebasex

3- rm -rf node_modules/ plugins/ platforms/android package-lock.json

4- ionic cordova platform add android && npm install

现在它起作用了。

票数 53
EN

Stack Overflow用户

发布于 2019-05-07 18:16:53

我在Yannic Hamann answer (Ionic Forum)中提到的论坛中为我找到了一个解决方案。

来自systems_qualigy here的评论是关于在project.properties中锁定版本。

代码语言:javascript
复制
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

我还需要锁定

代码语言:javascript
复制
com.google.android.gms:play-services-tagmanager:16.0.8

我接受了Martins answer的版本,可以成功地重新构建我的项目。

票数 19
EN

Stack Overflow用户

发布于 2019-05-17 23:41:01

我们现在正在维护一个分支版本,其中包含了不同作者所做的所有更改和修复(他们将每个人都从谷歌的这一举动中拯救了出来)。

https://github.com/wizpanda/cordova-plugin-firebase-lib#difference-from-the-fork-repository

因此,现在只需使用以下命令删除现有插件:

代码语言:javascript
复制
ionic cordova plugin remove cordova-plugin-firebase

现在,使用以下命令安装新版本

代码语言:javascript
复制
ionic cordova plugin add cordova-plugin-firebase-lib --save

干杯!

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56014935

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档