这就是方法数越界了,解决办法:
在Gradle 配置:
defaultConfig {
applicationId “XXX”
minSdkVersion 19
targetSdkVersion 23
multiDexEnabled true
}
dependencies {
compile ‘com.android.support:multidex:1.0.0’
}
Application 类重写方法:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
本文详细介绍了在Android开发中遇到的方法数超过65536的限制问题及其解决方案。通过启用multiDex并配置Gradle,同时在Application类中重写attachBaseContext方法,可以有效解决方法数超限的问题。
2391

被折叠的 条评论
为什么被折叠?



