在Cordova中添加Google Analytics(分析)插件时,构建android应用失败

时间:2019-01-06 11:07:30

标签: android cordova google-analytics google-play-services cordova-plugins

我将cordova-plugin-google-analytics添加到了我的cordova应用程序中,并在尝试将项目构建到android paltform时出错(直到添加此插件-效果很好)。

似乎某些插件所依赖的Google-Play-Service版本之间存在冲突,而我正在尝试解决这些冲突,但直到现在-都没有成功。

我用来构建项目的命令:

cordova build android -- --keystore=keystore-path --storePassword=myStorePaswword --alias=myalias --password=myPassword

这是我得到的错误:

* What went wrong:
Execution failed for task 
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: 
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

这是我在config.xml文件中定义的插件:

<plugin name="cordova-plugin-camera" spec="^1.0.0" />
<plugin name="cordova-plugin-compat" spec="^1.0.0" />
<plugin name="cordova-plugin-device" spec="^2.0.1" />
<plugin name="cordova-plugin-file" spec="^4.3.3" />
<plugin name="cordova-plugin-geolocation" spec="^2.4.3" />
<plugin name="cordova-plugin-googleplus" spec="git+https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git#993e0c8abfd24dbf8de9d741296beec369976d8f" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<plugin name="cordova-plugin-media" spec="^2.4.1" />
<plugin name="cordova-plugin-media-capture" spec="^1.4.3" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-android-permissions" spec="~1.0.0" />
<plugin name="cordova-plugin-app-version" spec="~0.1.9" />
<plugin name="phonegap-plugin-mobile-accessibility" spec="git+https://github.com/phonegap/phonegap-mobile-accessibility.git" />
<plugin name="cordova-plugin-googleplayservices" spec="^19.0.3" />
<plugin name="cordova-plugin-google-analytics" spec="1.8.6" />
<plugin name="cordova-play-services-version-adapter" spec="^1.0.2" />

我花了很多时间尝试解决此错误。有任何想法吗?非常感谢

0 个答案:

没有答案