DexIndexOverflowException issue after updating to latest appcompat and support library
2016-04-27 10:22
429 查看
今天遇到这个错误:
support.Just add these lines in the
the
from the multidex support library to the application element
change the parent class from
com.android.dex.DexIndexOverflowException: method ID notin[0,0xffff]:65536
找了好久发现了解决办法:This message sounds like your project is too large.You have too many methods. There can only be 65536 methods for dex.Since the gradle plugin 0.14.0 and the Build Tools 21.1.0 you can use the multidex
support.Just add these lines in the
build.gradle:
android {defaultConfig {Also in your
...// Enabling multidex support.
multiDexEnabled true
}
...
}dependencies {
compile 'com.android.support:multidex:1.0.0'
}
Manifestadd
the
MultiDexApplicationclass
from the multidex support library to the application element
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application> </manifest>If you are using a own
Applicationclass,
change the parent class from
Applicationto
MultiDexApplication.或者:If your app uses extends the Application class add this code
@Override public void attachBaseContext(Context base) { MultiDex.install(base); super.attachBaseContext(base); }
转载自:http://stackoverflow.com/questions/26515378/dexindexoverflowexception-issue-after-updating-to-latest-appcompat-and-support-l
相关文章推荐
- iOS开发之KVC全解
- Mybatis3.3.x技术内幕(二):动态代理之投鞭断流(自动映射器Mapper的底层实现原理)
- 六、策略设计模式
- (一)C# winform C/S WebBrowser 微信第三方登录
- APP打包后上传遇到ERROR ITMS-90096解决办法
- Java 对象流ObjectInputStream和ObjectOutputStream类
- android 刮刮卡效果
- IOS 读二进制数据文件
- iOS tableViewCell 代理
- Android中用onSaveInstanceState保存Fragment状态的方法
- android之绘制相关类
- Unity AssetStore下载目录
- cocos2d-x Tiled地图坐标转换
- iOS_时间戳与时间间的互相转化
- iOS~runtime理解
- 安卓Selector失效、无用的解决方案
- Android快捷方式
- Android 图片填充动画
- Android学习路线总结,绝对干货(转)
- android从案例学习RxAndroid