首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PhoneGap生成-无法获取类型为org.gradle的对象的未知属性“”GMS_VERSION“”

PhoneGap生成-无法获取类型为org.gradle的对象的未知属性“”GMS_VERSION“”
EN

Stack Overflow用户
提问于 2018-07-27 19:33:03
回答 1查看 1.4K关注 0票数 1

从一天到另一天,我的构建都失败了,以下是我从phonegap构建中获得的日志:

代码语言:javascript
复制
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

我认为splashscreen插件有问题,所以我对它进行了降级,然后删除了它,但后来构建总是失败,并抱怨另一个插件出现了基本上相同的错误。我对Gradle文件了解不多,据我所知,PhoneGap Build负责处理它,或者至少它应该处理它。

我使用的是Phonegap-cli 6.4,这个版本是为Android构建的。

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

更新:获得成功构建的唯一方法是从config.xml中删除所有插件:'( (...and now?还在想办法添加插件的另一种方法。

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

代码语言:javascript
复制
--------------------------------------------------------------------------------
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)

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-03 22:15:40

在我的config.xml中删除这行代码后,我获得了成功的构建

代码语言:javascript
复制
<plugin name="cordova-plugin-google-analytics" source="npm" />

也许这个插件有问题...

祝好运!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51557082

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档