我试图添加https://github.com/nickdrewe/google-analytics-plugin到我的cordova项目。但是构建失败了。以下是我尝试过的:
-
安装google playservices 21而不是19。
编辑plugin.xml指向21,但仍然不能工作。 完全删除google playservices并使用框架代替https://github.com/nickdrewe/google-analytics-plugin/commit/cb8e78f17472ae2c8b4db613273764a7260b4e34,但仍然构建错误
我也尝试了
android update sdk --no-ui --all --filter "extra-google-m2repository"
从https://groups.google.com/forum/#!主题/adt-dev UXW0Hl0UVXk
我得到的错误:
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)
我使用Ionic 1.5.5和Cordova Android 4.0.2
帮忙吗?
我是开放的替代谷歌分析插件,但我发现https://github.com/phonegap-build/GAPlugin导致Android应用程序在启动时崩溃。
我只是试图重现您的错误-没有。我用你链接的插件和控制台插件建立了一个新项目。构建是完全好的和成功的。
据我所知,你编辑了gradle构建设置以加速gradle构建。-Dorg.gradle.daemon=true
……就我阅读文件而言,这必须是-org.gradle.daemon=true
或D
sth像一个操作符或一个变量,必须在那里?
您还可以尝试以管理员身份运行cmd
。
Cordova从5.1.1降级到4.3.2修复了许多用户的问题。