我昨天遇到了一个问题,涉及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)
更多背景信息:
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更新软件包,但这似乎没有任何帮助。
答案 0 :(得分:0)
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