android : Error converting byte to dex

后端 未结 30 1695
鱼传尺愫
鱼传尺愫 2020-12-01 10:25

So, I am getting the following error while running the project after upgrading build.gradle (Project) from

dependencies {
        classpath \'com.android.too         


        
相关标签:
30条回答
  • 2020-12-01 10:37

    If you bring in to the code same library from 2 different sources that will cause the error.

    0 讨论(0)
  • 2020-12-01 10:38

    I've noticed this can happen (sometimes) when editing java files while Android Studio is building.

    I solved this by manually deleting the build folder and running agin.

    0 讨论(0)
  • 2020-12-01 10:39

    If you are applying any plugins. Then, in your module Gradle file (usually the app/build.gradle),make sure you add the apply plugin line at the bottom of the file to enable the Gradle plugin.

    e.g.

    0 讨论(0)
  • 2020-12-01 10:39
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile fileTree(include: 'Parse-*.jar', dir: 'libs')
        compile 'com.android.support:appcompat-v7:23.2.0'
        compile 'com.android.support:cardview-v7:23.2.0'
        compile 'com.android.support:design:24.0.0-alpha1'
        compile "com.google.firebase:firebase-invites:9.2.0"
        compile "com.google.firebase:firebase-ads:9.2.0"
        compile 'com.google.firebase:firebase-database:9.2.0'
        compile 'com.google.firebase:firebase-core:9.2.0'
    }
    

    I add the com.google.firebase:firebase-core:9.2.0 line and choose the same version (9.2.0) for all firebase libraries and the issue was solved.

    0 讨论(0)
  • 2020-12-01 10:39

    I had the same problem and it is caused by not same version of google analytics and firebase. I used 'com.google.gms:google-services:3.1.0' and then add these dependencies:

    compile 'com.google.android.gms:play-services-gcm:10.2.6'
    compile 'com.google.firebase:firebase-crash:10.0.1'
    

    So change firebase version to 10.2.6 fix this problem.

    compile 'com.google.android.gms:play-services-gcm:10.2.6'
    compile 'com.google.firebase:firebase-crash:10.2.6'
    
    0 讨论(0)
  • 2020-12-01 10:41

    Check you build.gradle (Module: your app).

    All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes).

    For example: If you have com.google.firebase:firebase-ads:9.6.1 and com.google.android.gms:play-services-basement:10.0.1

    You have to change the firebase version to: 10.0.1

    0 讨论(0)
提交回复
热议问题