Weird : UNEXPECTED TOP-LEVEL EXCEPTION: Execution failed for task app:dexDebug

前端 未结 4 1998
滥情空心
滥情空心 2020-12-03 18:13

I didn\'t implement new libs but this problem occured while coding :

Error:Execution failed for task \':app:dexDebug\'.

com.android.ide.commo

相关标签:
4条回答
  • 2020-12-03 18:59

    Adding multiDexEnabled true in defaultConfig in build.gradle solved my problem

    defaultConfig {
            applicationId "com.example.project"
            minSdkVersion 15
            targetSdkVersion 21
            versionCode 1
            versionName "1.0.0"
            multiDexEnabled true
        }
    
    0 讨论(0)
  • 2020-12-03 19:03

    You may have hit the 65k methods limit. To use Google Play Services with more granularity, follow this guide, you can use only the parts that you want. This will possibly fix your problem.

    0 讨论(0)
  • 2020-12-03 19:10

    You can fix the limit issue by enabling multdex in your build.gradle by adding "multiDexEnabled true". For more information see http://android-developers.blogspot.com.es/2014/12/google-play-services-and-dex-method.html

    Referred from Why did this happen? How do i fix this? Android: UNEXPECTED TOP-LEVEL EXCEPTION:.

    0 讨论(0)
  • 2020-12-03 19:16

    I solved my problem with adding these in build gradle:

        defaultConfig {
          multiDexEnabled true
    
    
        dependencies {
          compile 'com.android.support:multidex:1.0.0'
    

    another solution can be removing unnecessary libraries

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