google官方提供了多dex的支持库,因此,我们可以很简单的解决这个问题
配置build.gradle
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies{
compile 'com.android.support:multidex:1.0.0’ //dependencies
}
下面这行代码比较能解决问题!!!
compile 'com.android.support:multidex:1.0.0’ //dependencies