Cordova - 多个dex文件定义(注释) [英] Cordova - Multiple dex files define (annotation)

查看:306
本文介绍了Cordova - 多个dex文件定义(注释)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个离子项目。安装 Facebook插件后,我无法再为Android构建项目!



命令

  ionic build android 



向我显示此错误讯息

 未知的顶级例外:
com.android.dex.DexException:多个dex文件定义了Landroid / support / annotation / AnimRes;

我正在阅读很多关于这个错误的教程/答案,使用带有推送通知插件的Facebook插件。



这是两天我尝试了很多不同的解决方案,但没有一个是工作:(



这里有一些关于我的配置的信息: / p>

  plugin com.phonegap.plugins.PushPlugin version 2.5.0 
plugin com.phonegap.plugins.facebookconnect version 0.11。 0(与本地存储库一起安装,如github上所示)
cordova version 5.0
ionic version 1.6.3

看来这个问题与支持注释库加载了几次有关。我真的不知道这是可能的,我可以检查它。



你能帮助我吗?你有任何想法如何使这个工作吗?
有离子/ cordova配置文件,我可以检查依赖吗?



提前感谢。

解决方案

出现多个dex文件错误,因为在ionic / cordova项目中使用多个支持jar文件



您需要在platforms / android下更改build.gradle



找到以下行

  apply plugin:'com.android.application'
 配置{

 




all * .exclude group:'com.android.support',module:'support-v4'
}


I'm working on a project with ionic. After I installed the Facebook Plugin I'm not able to build the project for android anymore!

The command

ionic build android

gives me this error message

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;

I'm reading a lot of tutorials/answers about this error and it seems to be related to the use of the Facebook Plugin with the Push Notification Plugin.

It's two days I'm trying a lot of different solutions, but none of those is working :(

Here are some information about my configuration:

plugin com.phonegap.plugins.PushPlugin version 2.5.0
plugin com.phonegap.plugins.facebookconnect version 0.11.0 (installed with the local repository, as indicated on github)
cordova version 5.0
ionic version 1.6.3

It looks like this problem is related to the "support-annotations" library loaded several times. Buy I really don't know how this is possible and where I can check it.

Can you help me? Do you have any idea of how to make this working? Is there a ionic/cordova configuration file where I can check the dependencies?

Thanks a lot in advance.

解决方案

Multiple dex files error is raised because of using multiple support jar files in the ionic / cordova project

you need to change build.gradle under platforms/android

find the below line

apply plugin:'com.android.application'

after add these below lines

configurations {
   all*.exclude group: 'com.android.support', module: 'support-v4'
} 

这篇关于Cordova - 多个dex文件定义(注释)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆