从一天到另一天,我的构建都失败了,以下是我从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我认为splashscreen插件有问题,所以我对它进行了降级,然后删除了它,但后来构建总是失败,并抱怨另一个插件出现了基本上相同的错误。我对Gradle文件了解不多,据我所知,PhoneGap Build负责处理它,或者至少它应该处理它。
我使用的是Phonegap-cli 6.4,这个版本是为Android构建的。
如果你需要更多的帮助信息,请告诉我,非常感谢:)
更新:获得成功构建的唯一方法是从config.xml中删除所有插件:'( (...and now?还在想办法添加插件的另一种方法。
更新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)类似的错误-不知道发生了什么
发布于 2018-08-03 22:15:40
在我的config.xml中删除这行代码后,我获得了成功的构建
<plugin name="cordova-plugin-google-analytics" source="npm" />也许这个插件有问题...
祝好运!
https://stackoverflow.com/questions/51557082
复制相似问题