简体   繁体   English

使用Cordova google-analytics-plugin时发生构建错误

[英]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: 这是我尝试过的:

  1. 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,但仍然无法使用。

  2. 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,但仍会生成错误

  3. 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=trueD像操作符还是必须存在的变量?

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.

相关问题 科尔多瓦插件:danwilson / google-analytics-plugin在Android设备上不起作用 - Cordova plugin: danwilson/google-analytics-plugin not working on android device 在Android中使用离子的Cordova Google-analytics-plugin不起作用 - Cordova Google-analytics-plugin with ionic in Android does not work Cordova构建失败-Google Analytics和Facebook插件冲突 - Cordova build failed - google analytics and facebook plugin conflicts 仅Android上带有Google Analytics(分析)插件的PhoneGap / Cordova应用程序错误 - PhoneGap/Cordova Application with Google Analytics Plugin error on Android only 使用Cordova应用中的cordova-plugin-firebase-analytics插件,Android上的google_app_id错误无效 - Invalid google_app_id error on Android with cordova-plugin-firebase-analytics plugin in Cordova app 使用Google Analytics和odfuscation时生成错误 - Build error when use Google Analytics and odfuscation Cordova EmailComposer插件构建错误 - Cordova EmailComposer plugin build error Cordova Google Analytics(分析)插件在本地运行,但无法从Play商店安装时使用 - Cordova Google Analytics plugin working locally but not when installed from Play Store 使用 Phonegap 构建时cordova-plugin-whitelist 不起作用 - cordova-plugin-whitelist not working when using Phonegap build 使用cordova build --release android时离子构建android错误 - ionic build android error when using cordova build --release android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM