我的应用程序中出现了一些与multidex支持有关的问题,实际上应用程序安装正常,但通过此过程,一些活动崩溃并且应用程序重新启动主要活动。在logcat中我发现这一点:已禁用Android Multidex支持库
I/MultiDex: install
I/MultiDex: VM has multidex support, MultiDex support library is disabled.
但我跟着建议,以使Multidex支持:
摇篮:
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com..company.package"
minSdkVersion 15
targetSdkVersion 25
multiDexEnabled true
versionCode 21
versionName "2.1.3"
}
dexOptions {
javaMaxHeapSize "4g"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile project(':rangebar')
compile('com.github.afollestad.material-dialogs:core:[email protected]') { transitive = true }
compile('com.weiwangcn.betterspinner:library-material:1.1.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile files('libs/itextpdf-5.5.9.jar')
compile 'com.android.support:multidex:1.0.1'
...
应用类扩展Multidex:
public class MyApplication extends MultiDexApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
我不不知道我完全错过了什么来摆脱这件事
在此先感谢。
你要么使用multidex使用都是毫无意义的都做同样的 –
@ M.Ashish是感谢你对attachBaseContext方法安装或扩展MultidexApplication,它的伎俩 – Houssem