gpt4 book ai didi

android - 带有 Cordova 错误的 Google GCM

转载 作者:行者123 更新时间:2023-12-03 04:35:18 24 4
gpt4 key购买 nike

添加后,Cordova GCM push plugins我的构建遇到了一些问题,并且确实解决了它,如 thread 所示.

最近,构建再次开始失败,除了这个异常(exception):

Found com.google.android.gms:play-services-location:+, but version 8.3.0 is needed for the google-services plugin.
:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.

我想,这来自 build.gradle platform/android 内的文件
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile project(path: "CordovaLib", configuration: "debug")
releaseCompile project(path: "CordovaLib", configuration: "release")
compile "com.facebook.android:facebook-android-sdk:4.+"
compile "com.google.android.gms:play-services-location:+" // This line in particular
// SUB-PROJECT DEPENDENCIES END
}

无法直接编辑此文件,所以我创建了一个 build-extras.gradle文件:
configurations.all{
resolutionStrategy{
force ("com.google.android.gms:play-services-location:8.3.0")
}
}

但我无法解决它。我仍然收到与上述相同的错误。

Google 在 8.3 release notes 中指定了一个与此类似的错误。 .如上所述,我已经指定了版本,更新了我的构建工具,播放服务 repo。

最佳答案

我用另一个插件遇到了这个问题,我用 after_platform_add 中的这个钩子(Hook)修复了它:

#!/usr/bin/env node


var fs = require('fs');
var path = require('path');
var fork = require('child_process').fork,
shell = require("shelljs");

var dir = './platforms/android/';
if (fs.existsSync(dir)){
fs.writeFileSync(dir + 'build-extras.gradle', 'configurations { all*.exclude group: \'com.android.support\', module: \'support-v4\'}', 'utf8');
}

希望有帮助

关于android - 带有 Cordova 错误的 Google GCM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34411498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com