使用Cordova google-analytics-plugin时出错

时间:2015-07-10 03:35:55

标签: android cordova google-analytics ionic-framework phonegap-plugins

我正在尝试将https://github.com/nickdrewe/google-analytics-plugin添加到我的cordova项目中。但是构建失败了。以下是我的尝试:

  1. 安装google playservices 21而不是19.编辑plugin.xml指向21但仍然无法正常工作。

  2. 完全删除google playservices并使用框架代替https://github.com/nickdrewe/google-analytics-plugin/commit/cb8e78f17472ae2c8b4db613273764a7260b4e34,但仍会构建错误

  3. 我还尝试了https://groups.google.com/forum/#!topic/adt-dev/UXW0Hl0UVXk

  4. 中的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)

    我得到的错误:

    Here is a "|space|" and a non-breaking space (|nbspc|)
    
    .. |space| unicode:: U+0020 .. space
    .. |nbspc| unicode:: U+00A0 .. non-breaking space
    

    我正在使用Ionic 1.5.5和Cordova Android 4.0.2

    任何帮助?

    我对其他Google Analytics插件持开放态度,但我发现https://github.com/phonegap-build/GAPlugin导致Android应用在启动时崩溃。

1 个答案:

答案 0 :(得分:0)

我只是试图重现你的错误 - 而且没有。我使用您链接的插件和控制台插件构建了一个新项目。构建完全正常并且成功。

据我所知,您编辑了gradle构建设置以加快gradle构建。 -Dorg.gradle.daemon=true ...据我阅读的文件而言,这必须是-org.gradle.daemon=true,或者D某个运营商或变量必须在那里?

您还可以尝试以管理员身份运行cmd

Cordova从5.1.1降级到4.3.2解决了许多用户的问题。