Android studio 2.0 gradle transformClassesWithDexForDebug fails when using button “run”

后端 未结 14 1894
被撕碎了的回忆
被撕碎了的回忆 2020-12-25 11:21

I have a problem after migration from android studio 1.5 to 2.0

In one of my project (only one) i can\'t use android studio run button,

because then, build

14条回答
  •  生来不讨喜
    2020-12-25 12:00

    None of the above worked for me, but this developer.android.come guide worked out for me:

    https://developer.android.com/studio/build/multidex.html

    It says the following:

    If your minSdkVersion is set to 21 or higher, all you need to do is set multiDexEnabled to true in your module-level build.gradle file, as enter code hereshown here:

    android {
        defaultConfig {
            ...
            minSdkVersion 21 
            targetSdkVersion 25
            multiDexEnabled true
        }
        ...
    }
    

    However, if your minSdkVersion is set to 20 or lower, then you must use the multidex support library as follows:

    Modify the module-level build.gradle file to enable multidex and add the multidex library as a dependency, as shown here:

    android {
        defaultConfig {
            ...
            minSdkVersion 15 
            targetSdkVersion 25
            multiDexEnabled true
        }
        ...
    }
    
    dependencies {
      compile 'com.android.support:multidex:1.0.1'
    }
    

提交回复
热议问题