Answer the question
In order to leave comments, you need to log in
How to increase build speed in AndroidStudio if multidex is used?
Hello! I reached the limit of 65k methods in my application, I had to connect multidex. But the time spent on the build has increased many times, if not dozens of times. I found this method, however, after that the application began to crash with an exception
ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication"
apply plugin: 'com.android.application'
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
targetSdkVersion 23
versionCode 5
versionName "0.5"
multiDexEnabled true
}
productFlavors {
dev {
minSdkVersion 21
}
prod {
minSdkVersion 14
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'org.jsoup:jsoup:1.8.2'
compile 'com.google.android.gms:play-services-maps:8.3.0'
compile 'com.google.android.gms:play-services-appindexing:8.3.0'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile 'com.google.android.gms:play-services-plus:8.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.quinny898.library.persistentsearch:library:1.0.0-SNAPSHOT'
compile 'com.android.support:design:23.0.1'
compile('io.socket:socket.io-client:0.6.2') {
exclude group: 'org.json', module: 'json'
}
compile 'org.parceler:parceler:1.0.4'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile files('libs/universal-image-loader-1.9.4.jar')
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.ms-square:expandableTextView:0.1.4'
compile 'uk.me.lewisdeane.ldialogs:[email protected]'
compile 'com.daimajia.slider:library:[email protected]'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.orhanobut:dialogplus:[email protected]'
compile 'com.appyvet:materialrangebar:1.1'
compile 'com.cocosw:bottomsheet:1.2.0'
}
android:name="android.support.multidex.MultiDexApplication"
Answer the question
In order to leave comments, you need to log in
And what build option did you choose in the studio? should be devrelease or something like that. There is a suspicion that you are building the entire project at once, and when you build prodrelease, it will crash. You can also try to extend from the usual application and limit yourself to the method
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question