Ionic v4:依赖关系失败:com.google.android.gms:play-services-measurement-api:16.5.0

问题描述

我去年制作了一个离子应用程序,现在我尝试集成Admob Free插件,但是构建出错。 我尝试了一些解决错误解决方案,但仍然没有任何好的结果。

我为解决该问题所做的事情: 1-)google-services-x库为11.0.4,在platform / android / project.properties中将它们更改为19.5.0:

cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.google.firebase:firebase-core:16.0.9
cordova.system.library.3=com.google.firebase:firebase-messaging:18.0.0
cordova.gradle.include.2=cordova-plugin-fcm-with-dependecy-updated/footballxy-FCMPlugin.gradle
cordova.system.library.4=com.android.support:support-annotations:27.+
cordova.system.library.5=com.google.android.gms:play-services-base:19.5.0
cordova.system.library.6=com.google.android.gms:play-services-ads:19.5.0

2-)还将它们在platform / android / app / build.gradle中更改为19.5.0

dependencies {
    implementation filetree(dir: 'libs',include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: ":Cordovalib"))
    implementation "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
    implementation "com.google.firebase:firebase-core:16.0.9"
    implementation "com.google.firebase:firebase-messaging:18.0.0"
    implementation "com.android.support:support-annotations:27.+"
    implementation "com.google.android.gms:play-services-base:19.5.0"
    implementation "com.google.android.gms:play-services-ads:19.5.0"
    // SUB-PROJECT DEPENDENCIES END
}

3-)还要在plugins / cordova-admob-sdk / plugin.xml中将播放服务的认版本设置为19.5.0

<platform name="android">
        <preference name="PLAY_SERVICES_VERSION" default="19.5.0"/>
        <framework src="com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION" />
        <framework src="com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION" />
    </platform>

这是我的错误

What went wrong:
Failed to capture fingerprint of input files for task ‘:app:preDebugBuild’ property ‘compileManifests’ during up-to-date check.
In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version (e.g. “[16.5.
0]”,but isn’t being resolved to that version. Behavior exhibited by the library will be unkNown.

Dependency failing: com.google.android.gms:play-services-measurement-api:16.5.0 -> com.google.android.gms:play-services-
measurement-sdk-api@[16.5.0],but play-services-measurement-sdk-api version was 17.0.0.

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-ads@18.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-sdk@16.5.0
– Project ‘app’ depends onto com.google.firebase:firebase-analytics@16.5.0
– Project ‘app’ depends onto com.google.android.gms:play-services-ads@19.5.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-sdk-api@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-api@16.5.0
– Project ‘app’ depends onto com.google.firebase:firebase-core@16.0.9
– Project ‘app’ depends onto com.google.android.gms:play-services-ads-lite@18.0.0

谢谢师父!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)