Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza;

本小妞迷上赌 提交于 2019-12-13 08:03:07

问题


I have this error:

Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza;

I am not getting how to solve this, please help.

I don't know whether to include some lib or what


回答1:


you need to use same version of firebase dependencies

compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'

or

 compile 'com.google.firebase:firebase-auth:9.6.1'
 compile 'com.google.firebase:firebase-database:9.6.1'



回答2:


The problems of Multiple dex files define usually arise when you have duplicate dependency entry in your app build.gradle. In this case, you have a duplicate Firebase dependencies.

You need to use the same version either 9.0.2 or 9.6.1:

compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'

or

compile 'com.google.firebase:firebase-auth:9.6.1'
compile 'com.google.firebase:firebase-database:9.6.1'

Please be aware that if you use some support library version like 24.0.0 there is a chance for compatibility issue with firebase. You need to use the latest of support library or find the compatible firebase version. Read more at android error while compiling com.android.support:support-v4:24.0.0



来源:https://stackoverflow.com/questions/46616294/errorerror-converting-bytecode-to-dex-cause-com-android-dex-dexexception-mul

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!