Phonegap Build:找不到任何与 com.google.android.gms:play-services-gcm:12+ 匹配的版本
Posted
技术标签:
【中文标题】Phonegap Build:找不到任何与 com.google.android.gms:play-services-gcm:12+ 匹配的版本【英文标题】:Phonegap Build: Could not find any version that matches com.google.android.gms:play-services-gcm:12+ 【发布时间】:2018-09-07 14:08:52 【问题描述】:我昨天在处理 gradle 时遇到了问题。为了解决这个问题,我做了以下事情:
$phonegap platform remove android
$phonegap platform add android@^6.3.0 (previously i was using 6.3.0, this moved it to 6.4.0)
$brew update && brew install gradle
现在当我在本地构建项目时,一切都很顺利,没有错误
当我去 phonegap 构建并远程构建它时,我遇到了失败:
* What went wrong:
A problem occurred configuring root project 'www_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
Searched in the following locations:
file:/opt/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-gcm /maven-metadata.xml
file:/sdk-manager/com/google/android/gms/play-services-gcm/maven-metadata.xml
file:/sdk-manager/com/google/android/gms/play-services-gcm/
file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-gc m/maven-metadata.xml
file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-gc m/
file:/sdk-manager/com/google/android/gms/play-services-gcm/maven-metadata.xml
file:/sdk-manager/com/google/android/gms/play-services-gcm/
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
更多上下文:
使用 cli-7.0.1 engine name="android" spec="6.4.0"(如前所述:6.3.0)project.properties:
target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=bidwrangler-opentok-plugin/stevechuppauctions-build-extras.gradle
cordova.gradle.include.2=cordova-plugin-safariviewcontroller/stevechuppauctions-SafariView Controller-java18.gradle
cordova.system.library.1=com.android.support:customtabs:23.2.0
cordova.gradle.include.3=phonegap-plugin-push/stevechuppauctions-push.gradle
cordova.system.library.2=com.android.support:support-v13:23+
cordova.system.library.3=com.google.android.gms:play-services-gcm:11+
cordova.system.library.4=me.leolin:ShortcutBadger:1.1.14@aar
我尝试通过 Android Studio 更新软件包,但这似乎没有任何帮助。
【问题讨论】:
你有哪些插件? 【参考方案1】:cordova.system.library.3=com.google.android.gms:play-services-gcm:12.0.1
您是否尝试过使用此更新您的 project.properties?
我发现通常需要两件事。所有 google 和 firebase 的东西都必须在 project.properties 中设置为相同的版本,这也需要添加到其中:
cordova.system.library.7=com.android.support:appcompat-v7:27.1.0
【讨论】:
如果我手动更新它们,但当我进行全新构建时,它们将被清除。 您的 project.properties 不应被清除。这应该由你设置。以上是关于Phonegap Build:找不到任何与 com.google.android.gms:play-services-gcm:12+ 匹配的版本的主要内容,如果未能解决你的问题,请参考以下文章
Gradle 错误:找不到任何匹配 com.android.tools.build:gradle:2.2.+ [重复]
找不到 com.android.tools.build:gradle:5.1.1
PhoneGap 错误:找不到插件“LowLatencyAudio”,或者不是 CDVPlugin