依存关系失败:Google Play服务库的依存关系依赖于另一个版本,但没有被解析为该版本

时间:2019-12-30 11:14:43

标签: android ionic-framework android-gradle-plugin google-play-services build.gradle

我正在构建一个离子应用程序,并且我不想在平台文件夹或平台中的任何文件夹的app.properties中进行更改,因为它在使用CI-CD时也会受到影响,因此我想修复它无需在ionic应用程序的平台文件夹中进行任何更改。

错误:在项目“应用”中,已解析的Google Play服务库依赖项依赖于另一个版本(例如“ [15.0。 1]”,但尚未解决该版本。该库显示的行为将是未知的。

app.properties:

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-android-support-gradle-release/citizen-cordova-android-support-gradle-release.gradle
cordova.gradle.include.2=cordova-plugin-telerik-imagepicker/citizen-ignorelinterrors.gradle
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.facebook.android:facebook-android-sdk:4.40.0
cordova.system.library.4=com.android.support:support-v4:25.+
cordova.system.library.5=com.android.support:appcompat-v7:25.+
cordova.system.library.6=com.google.android.gms:play-services-analytics:15.0.1
cordova.system.library.7=com.google.android.gms:play-services-auth:15.0.1
cordova.system.library.8=com.google.android.gms:play-services-identity:15.0.1
cordova.system.library.9=com.android.support:support-annotations:27.+
cordova.system.library.10=com.microsoft.azure:azure-mobile-android:3.4.0@aar
cordova.system.library.11=com.google.code.gson:gson:2.3
cordova.system.library.12=com.google.android.gms:play-services-location:16.+
cordova.system.library.13=com.android.support:appcompat-v7:23+
cordova.gradle.include.3=cordova-plugin-telerik-imagepicker/citizen-androidtarget.gradle
cordova.gradle.include.4=cordova-support-google-services/citizen-build.gradle
cordova.gradle.include.5=phonegap-plugin-multidex/citizen-multidex.gradle
cordova.system.library.14=com.android.support:support-v4:26.+
cordova.system.library.15=com.android.support:appcompat-v7:26.+
cordova.system.library.16=com.android.support:support-v13:27.+
cordova.system.library.17=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.18=com.google.firebase:firebase-messaging:17.3.2

确切的错误如下:

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-stats:15.0.1 -> com.google.android.gms:play-services-basement@[
15.0.1], but play-services-basement version was 16.0.1.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.google.android.gms:play-services-identity@15.0.1
-- Project 'app' depends onto com.google.firebase:firebase-messaging@17.3.2
-- Project 'app' depends onto com.google.android.gms:play-services-auth@15.0.1
-- Project 'app' depends onto com.google.android.gms:play-services-location@16.+

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dependency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your build.gradle file. 

有人可以帮助解决这个问题吗?预先感谢。

1 个答案:

答案 0 :(得分:0)

请勿尝试混用play-services依赖版本。始终使用相同版本

cordova.system.library.6=com.google.android.gms:play-services-analytics:15.0.1
cordova.system.library.7=com.google.android.gms:play-services-auth:15.0.1
cordova.system.library.8=com.google.android.gms:play-services-identity:15.0.1
cordova.system.library.12=com.google.android.gms:play-services-location:15.0.1