My project was compiling fine before updating the android studio. But after i updated android studio to v3.5 i can't compile my project. I am getting following error:
Cannot fit requested classes in a single dex file (# methods: 72945 > 65536)
I can't even change a single line code.
My gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.app"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
def retrofitVersion = "2.5.0"
def supportVersion = '1.0.0-beta01'
def glideVersion = "4.8.0"
def rxjava_version = '2.2.8'
def rxandroid_version = '2.1.1'
def dagger_version = "2.19"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.okhttp3:logging-interceptor:3.10.0"
def lifecycle_version = '2.1.0-alpha04'
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "com.google.android.material:material:$supportVersion"
def reactivestreams_version = '2.0.0-beta01'
implementation "androidx.lifecycle:lifecycle-reactivestreams:$reactivestreams_version"
def rxcalladapter_version = '2.5.0'
implementation "com.squareup.retrofit2:adapter-rxjava2:$rxcalladapter_version"
// Glide
implementation "com.github.bumptech.glide:glide:$glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"
implementation("com.github.bumptech.glide:recyclerview-integration:$glideVersion") {
transitive = false
}
implementation 'de.hdodenhof:circleimageview:3.0.0'
def room_version = '2.1.0-alpha07'
// Room
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
implementation 'com.google.code.gson:gson:2.8.5'
// RxJava
implementation "io.reactivex.rxjava2:rxjava:$rxjava_version"
// RxAndroid
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version"
implementation 'androidx.room:room-rxjava2:2.0.0-beta01'
// Dagger
// def dagger_version = "2.16" // version used by google samples
// Dagger2 core
implementation "com.google.dagger:dagger:$dagger_version"
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
// Dagger Android
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'pub.devrel:easypermissions:3.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
//Camera library
implementation 'com.camerakit:camerakit:1.0.0-beta3.11'
implementation 'com.camerakit:jpegkit:0.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'
//Image Picker
implementation 'com.github.esafirm.android-image-picker:imagepicker:2.0.0'
//Audio recorder
def audio_recorder_version = "1.6.0"
implementation "com.github.piasy:rxandroidaudio:$audio_recorder_version"
implementation "com.github.piasy:AudioProcessor:$audio_recorder_version"
implementation 'com.hhl:gridpagersnaphelper:1.0.0'
implementation 'com.hhl:recyclerviewindicator:1.0.0'
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'
implementation 'com.github.ahmadmuzakki29:subtitle-collapsingtoolbar:v2'
implementation 'com.airbnb.android:lottie:3.0.7'
implementation 'com.android.billingclient:billing:2.0.1'
implementation 'com.jsibbold:zoomage:1.3.0'
implementation 'me.relex:circleindicator:2.1.4'
implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
}
I researched on stackoverflow for dex file errors, some people says "enabling instant run resolved the issue for me" I suspected about instant run because they have changed the instant run mechanism and removed instant run settings from android studio. Maybe this is the problem?
How can i resolve this problem without enabling multiDex support?
from Cannot fit requested classes in a single dex file after updating android studio
No comments:
Post a Comment