Android Studio中编译时遇到Finished with non-zero exit value 2的解决方法

最近在工作中遇到了Too many method references: 70555; max is 65536:Finished with non-zero exit value 2的问题,是dex中的方法过多造成的,在stackOverflow上找到了解决的方法:

1) include it in dependencies:

dependencies {
  ...
  compile 'com.android.support:multidex:1.0.0'
}

2) Enable it in your app:

defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion 21
    ....
    multiDexEnabled true
}

你可能感兴趣的:(android,studio)