【发布时间】:2015-09-28 16:29:41
【问题描述】:
我正在尝试将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 但仍然构建错误
我也从https://groups.google.com/forum/#!topic/adt-dev/UXW0Hl0UVXk尝试了
android update sdk --no-ui --all --filter "extra-google-m2repository"
我得到的错误:
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
有什么帮助吗?
我对替代 Google Analytics 插件持开放态度,但我发现 https://github.com/phonegap-build/GAPlugin 导致 Android 应用在启动时崩溃。
【问题讨论】:
标签: android cordova google-analytics ionic-framework phonegap-plugins