square / retrofit

A type-safe HTTP client for Android and the JVM
https://square.github.io/retrofit/
Apache License 2.0
43.04k stars 7.3k forks source link

NoClassDefFoundError: retrofit2/Callback; #2643

Closed yamila-fraiman closed 6 years ago

yamila-fraiman commented 6 years ago

My app is throwing this error: java.lang.NoClassDefFoundError: Failed resolution of: Lretrofit2/Callback;

multiDexEnabled is enabled and this is my gradle: `implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:preference-v14:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.github.johnkil.android-progressfragment:progressfragment:1.4.0'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.0@aar') {
    transitive = true
}
implementation 'com.ramotion.foldingcell:folding-cell:1.2.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.9.0"
implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.burgstaller:okhttp-digest:1.15'
implementation 'se.akerfeldt:okhttp-signpost:1.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation('com.squareup.retrofit2:converter-simplexml:2.3.0') {
    exclude group: 'stax'
    exclude group: 'xpp3'
}
implementation 'com.itextpdf:itextpdf:5.5.11'
implementation 'com.github.barteksc:android-pdf-viewer:2.7.0'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.evernote:android-job:1.2.0'
implementation 'com.github.grapesnberries:curlloggerinterceptor:0.1'`
JakeWharton commented 6 years ago

This is a packaging or multidex problem with your APK, not a problem with Retrofit. You can use tools like APK analyzer to ensure this class file in your APK.