PhoneGap构建-无法获得类型为org.gradle

时间:2018-07-27 11:33:03

标签: android cordova gradle phonegap-plugins phonegap-build

从一天到另一天,我的构建现在失败了,这些是我从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)

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

1 个答案:

答案 0 :(得分:0)

我成功构建了一个成功的删除我的config.xml中的这一行

<plugin name="cordova-plugin-google-analytics" source="npm" />

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

祝你好运!