多DEX文件定义LCOM /谷歌/安卓/ GMS /内部/ zzau [英] Multiple dex files define Lcom/google/android/gms/internal/zzau

查看:561
本文介绍了多DEX文件定义LCOM /谷歌/安卓/ GMS /内部/ zzau的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的错误 com.android.dex.DexException:多DEX文件定义LCOM /谷歌/安卓/ GMS /内部/ zzau; 当我运行我的应用程序
该文件的gradle是
应用

I get the error com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzau; when i run my app The gradle files are app

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.google.android.gms:play-services:7.0.+'
compile 'com.android.support:mediarouter-v7:21.0.3'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.4.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.edmodo:rangebar:1.0.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile project(':library_viewpager')
compile project(':androidHorizontalListView')
compile project(':CastCompanionLibrary')
compile project(':mobihelp_sdk_android_v1.4')
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile files('libs/Parse-1.9.2.jar')
compile files('libs/GoogleConversionTrackingSdk-2.2.2.jar')

}

CastCompanionLibrary

CastCompanionLibrary

dependencies {
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.android.support:mediarouter-v7:22.+'
compile 'com.google.android.gms:play-services-cast:7.5.0'
}

我要如何解决这个问题?我猜是因为我使用谷歌的模块和应用程序都在发挥服务出现错误。但版本不同。这是造成问题?

How do i fix this? i guess the error occurs because i use google play services in both the module and the app. but the versions are different. is that causing an issue?

推荐答案

我有类似的问题,你的问题帮我解决我的,可能会帮助你解决你的。问题是,你已经定义:

I had similar problem and your question helped me solve mine and probably will help you solve yours. Problem is that you have defined:

dependencies {
...
  compile 'com.google.android.gms:play-services-cast:7.5.0'
}

dependencies {
...
  compile 'com.google.android.gms:play-services:7.0.+'
...
}

由于谷歌的服务7.5.0,如果你使用的播放服务的单一模块,你不能同时使用整体发挥服务的依赖。解决办法是只选择那些你需要的,而不是全包服务,例如:

Since google services 7.5.0, if you're using single modules from play services you can't use whole play services as dependency simultaneously. Solution is to select only those services that you need instead of whole package e.g.:

而不是

dependencies {
...
  compile 'com.google.android.gms:play-services:7.0.+'
...
}

使用

dependencies {
...
  compile 'com.google.android.gms:play-services-maps:7.0.+'
  compile 'com.google.android.gms:play-services-location:7.0.+'
  compile 'com.google.android.gms:play-services-gcm:7.0.+'
...
}

另外,我不知道,但也许这将是在这两个gradle这个CONFIGS使用的谷歌服务的同一版本的好主意。

Also I'm not sure but probably it would be good idea to use the same version of google services in both gradle configs.

这篇关于多DEX文件定义LCOM /谷歌/安卓/ GMS /内部/ zzau的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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