[英]Build error when using Cordova google-analytics-plugin
I am trying to add https://github.com/nickdrewe/google-analytics-plugin to my cordova project. 我正在尝试将https://github.com/nickdrewe/google-analytics-plugin添加到我的cordova项目中。 But the build failed.
但是构建失败了。 Here are what I tried:
这是我尝试过的:
Install google playservices 21 instead of 19. Edit plugin.xml to point to 21 but still don't work. 安装google playservices 21而不是19。将plugin.xml指向21,但仍然无法使用。
Remove google playservices completely and use framework instead https://github.com/nickdrewe/google-analytics-plugin/commit/cb8e78f17472ae2c8b4db613273764a7260b4e34 but still build error 完全删除Google Play服务,并改用框架https://github.com/nickdrewe/google-analytics-plugin/commit/cb8e78f17472ae2c8b4db613273764a7260b4e34,但仍会生成错误
I also tried android update sdk --no-ui --all --filter "extra-google-m2repository"
from https://groups.google.com/forum/#!topic/adt-dev/UXW0Hl0UVXk 我还尝试了来自https://groups.google.com/forum/#!topic/adt-dev/UXW0Hl0UVXk的
android update sdk --no-ui --all --filter "extra-google-m2repository"
The error I got: 我得到的错误:
FAILURE: Build failed with an exception.
* What went wrong:
Failed to notify build listener.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
/vagrant/MyProject/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /vagrant/MyProject/platforms/android/gradlew with args: cdvBuildDebug,-b,/vagrant/MyProject/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /vagrant/MyProject/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /vagrant/MyProject/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
I am using Ionic 1.5.5 and Cordova Android 4.0.2 我正在使用Ionic 1.5.5和Cordova Android 4.0.2
Any help? 有什么帮助吗?
I am open to alternative Google Analytics plugin but I found https://github.com/phonegap-build/GAPlugin causing Android app crashing upon start. 我愿意使用其他Google Analytics(分析)插件,但发现https://github.com/phonegap-build/GAPlugin导致Android应用在启动时崩溃。
I just tried to reproduce your error - and there is none. 我只是想重现您的错误-没有错误。 I build a new project with the plugin you linked and also the console plugin.
我用您链接的插件以及控制台插件构建了一个新项目。 The build was totaly fine and successfull.
构建完全正常且成功。
As far as i see you edited your gradle build settings for speeding up the gradle build. 据我所知,您已经编辑了gradle构建设置以加快gradle构建。
-Dorg.gradle.daemon=true
... as far as i read through the documents this must be -org.gradle.daemon=true
or is the D
sth like an operator or a variable which has to be there? -Dorg.gradle.daemon=true
...就我通读文档而言,它必须是-org.gradle.daemon=true
或D
像操作符还是必须存在的变量?
What you can also try is to run the cmd
as an administrator. 您还可以尝试以管理员身份运行
cmd
。
Cordova downgrade from 5.1.1 to 4.3.2 fixed the problem for many users. 科尔多瓦从5.1.1降级为4.3.2修复了许多用户的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.