Android Studio Multiple dex files gradle error

前端 未结 4 1329
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 04:03

I get this error when I Run->app for an Android application in Android Studio

UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex file         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-19 04:10

    Here is the correct solution solution, worked for me. Excluding the guava-jdk5 dependency module from each individual import is counterproductive (for me it didn't work because I had some internal dependencies coming from my backend on which my app depends, and this exposes the real issue with this approach).

    The following solved the problem and is the recommended approach:

    configurations {
        all*.exclude group: 'com.google.guava', module: 'guava-jdk5'
    }
    

    Source: https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html

提交回复
热议问题