PhoneGap 构建 - 无法为 org.gradle 类型的对象获取未知 属性 'GMS_VERSION'

PhoneGap Build - Could not get unknown property 'GMS_VERSION' for object of type org.gradle

从一天到另一天,我的构建现在都在失败,这些是我从 phonegap 构建中获得的日志:

Total time: 2.61 secs
Subproject Path: CordovaLib
"plugman-151 install --platform android --project /project --plugin cordova-plugin-splashscreen --nohooks=.": Fetching plugin "cordova-plugin-splashscreen" via npm
Installing "cordova-plugin-splashscreen" at "5.0.2" for android
Subproject Path: CordovaLib
null

FAILURE: Build failed with an exception.

* Where:
Build file '/project/build.gradle' line: 253

* What went wrong:
A problem occurred evaluating root project 'project'.
> Could not get unknown property 'GMS_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.853 secs
Failed to install 'cordova-plugin-splashscreen': Error: /project/gradlew: Command failed with exit code 1
    at ChildProcess.whenDone (/project/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/gradlew: Command failed with exit code 1

我认为闪屏插件有问题,所以我将其降级,然后将其删除,但随后构建一直失败,抱怨另一个具有基本相同错误的插件。 我对 Gradle 文件了解不多,据我所知,PhoneGap Build 会处理它,或者至少应该处理它。

我正在使用 Phonegap-cli 6.4,构建是针对 Android 的。

如果您需要更多信息来帮助我,请告诉我,非常感谢 :)

更新:成功构建的唯一方法是从 config.xml 中删除所有插件 :'( :'( :'(...现在?仍在尝试找出另一种方法来然后添加插件。

更新 2:这些是我使用 Phonegap-Cli 7.0.1 时的日志

--------------------------------------------------------------------------------
COMPILE OUTPUT
--------------------------------------------------------------------------------
:wrapper

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
Subproject Path: CordovaLib
null
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_3165fehnqtadtl3m714hg3us5.run(/build.gradle:138)

FAILURE: Build failed with an exception.

* Where:
Build file '/build.gradle' line: 253

* What went wrong:
A problem occurred evaluating root project 'www_android'.
> Could not get unknown property 'GMS_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.08 secs
Error: /gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file '/build.gradle' line: 253

* What went wrong:
A problem occurred evaluating root project 'www_android'.
> Could not get unknown property 'GMS_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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)

类似错误 - 不知道发生了什么

我在 config.xml

中删除了这一行,构建成功
<plugin name="cordova-plugin-google-analytics" source="npm" />

可能是这个插件有问题...

祝你好运!