Android Studio——com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

来源:互联网 发布:淘宝会员号 编辑:程序博客网 时间:2024/05/18 03:41

http://blog.csdn.net/liu1164316159/article/details/40823871

http://www.cnblogs.com/yeahgis/p/4660873.html


调用的方法数超过了android设定的65536个(DEX 64K problem),进而导致dex无法生成


1、build.gradle

dependencies {    compile 'com.android.support:multidex:'
2、build.gradle


android {    compileSdkVersion 19    buildToolsVersion '19.1.0'    compileOptions {        sourceCompatibility JavaVersion.VERSION_1_7        targetCompatibility JavaVersion.VERSION_1_7    }    defaultConfig {        multiDexEnabled true    }
3、AndroidManifest.xml

<application          android:allowBackup="true"          android:icon="@drawable/ic_launcher"          android:label="@string/app_name"          android:theme="@style/AppTheme"          android:name="android.support.multidex.MultiDexApplication"          >

0 0
原创粉丝点击