找不到与com.google.android.gms匹配的任何版本:play-services-gcm:12+( [英] Could not find any version that matches com.google.android.gms:play-services-gcm:12+ (
问题描述
我正在尝试在Android上使用cordova 6.5.0编译离子3.20。
I'm trying to compile on ionic 3.20 with cordova 6.5.0 on Android.
我正在执行 cordova运行android
但每次我都得到:
I'm executing cordova run android
but everytime I'm getting:
Error: ~/Develop/blastbot-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find any version that matches com.google.android.gms:play-services-gcm:12+.
Versions that do not match:
11.0.4
11.0.2
11.0.1
11.0.0
10.2.6
+ 18 more
Required by:
:android:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
我安装了所有这些:
SDK Manager
我已经尝试执行 cordova平台rm android
& cordova平台rm android@6.2
或 cordova平台rm android
。两者都以相同的结果结束。下载了一百万个不同的SDK版本。
I've already tried executing cordova platform rm android
& cordova platform rm android@6.2
or cordova platform rm android
. Both ending in the same result. Downloaded a million different SDK's versions.
推荐答案
我试过 cordova平台添加android @ 5
以及之后 cordova运行android
,它就像一个魅力。
I tried cordova platform add android@5
and afterwards cordova run android
and it worked like a charm.
UPDATE
行abov部分解决了这个问题,但是我的目标API级别是23而不是25。问题,经过近一个半月的尝试不同的SDK tools / build-tools / Google repo组合我找到了解决方案。
The line abov "solved" the issue partially, but my targeted API level was 23 instead of 25. The issue, after almost month and a half of trying different SDK tools/build-tools/Google repo combinations I found the solution.
导航到 platforms / android / project.properties
并查找类似于
的行 cordova.system.library.2 = com.google.android.gms:play-services-gcm:12 +
注意最后 12 +
。只需将其更改为 11 +
即可完成此任务。希望没有人像我一样经历这个。
Notice that 12+
at the end. Simply change it to 11+
, that will do the job. Hope nobody goes through this like I did.
这篇关于找不到与com.google.android.gms匹配的任何版本:play-services-gcm:12+(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!