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

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

问题描述

我正在做一个 ionic 项目.在我安装了 Facebook 插件 之后,我无法再为 android 构建项目了!

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!

命令

ionic build android

给我这个错误信息

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

看起来这个问题与多次加载的support-annotations"库有关.购买 我真的不知道这怎么可能以及在哪里可以检查.

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.

你能帮我吗?你知道如何使这个工作吗?是否有可以检查依赖项的 ionic/cordova 配置文件?

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?

非常感谢.

推荐答案

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

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

需要修改platforms/android下的build.gradle

you need to change build.gradle under platforms/android

找到下面一行

apply plugin:'com.android.application'

在下面添加这些行后

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

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

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