Android - Converting classes with Multidexlist for debugging - Instagram JSON Parser

I am trying to compile and deploy an Android application, but I have a problem with MultiDex :

 Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. > java.lang.UnsupportedOperationException (no error message) 

I already tried to fix a lot, but they do not work.

What I already tried:

1. multiDexEnabled true

2. dexOptions

 dexOptions { javaMaxHeapSize "4g" preDexLibraries = false } 

3. Disabling Instant Run in Android Studio Settings

4. Restart Android Studio and the computer.

5. Clean and rebuild the project.

6. File> Invalid cache / restart.

7. compile 'com.android.support:multidex:1.0.1' [EDIT]

And finally reboot my life, but don't want anything to work.

What can be done to fix this problem?

Here is my gradle file

 buildscript { repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } } apply plugin: 'com.android.application' apply plugin: 'io.fabric' apply plugin: 'realm-android' android { compileSdkVersion 23 buildToolsVersion '24.0.1' defaultConfig { applicationId "com.XY" minSdkVersion 15 targetSdkVersion 21 versionCode 90 versionName "1.2.3" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/notice.txt' exclude 'META-INF/license.txt' exclude 'META-INF/dependencies.txt' exclude 'META-INF/LGPL2.1' } } repositories { jcenter() maven { url 'https://maven.fabric.io/public' } maven { url 'https://dl.bintray.com/X/maven/' } maven { url "https://jitpack.io" } flatDir { dirs 'libs' } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:23.0.1' // Utils //ANR Helper & Memory Leaks helper //compile 'com.github.anrwatchdog:anrwatchdog:1.1.+' //compile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2' // HoneyWell sdk compile files('libs/honeywell.jar') // RealmAdapter compile 'io.realm:android-adapters:1.2.1' // Volley compile 'com.mcxiaoke.volley:library:1.0.19' // EventBus // compile 'org.greenrobot:eventbus:3.0.0' // Gson compile 'com.google.code.gson:gson:2.3.1' // Jjp compile 'com.instagram:ig-json-parser-processor:0.0.6+' // Sticky List headers compile 'se.emilsjolander:stickylistheaders:2.7.0' // Parallax compile 'com.github.nirhart:parallaxscroll:1.0' // Facebook compile 'com.facebook.android:facebook-android-sdk:4.6.0' // Zbar compile 'me.dm7.barcodescanner:zbar:1.9' // NumberProgressBar compile 'com.daimajia.numberprogressbar:library: 1.2@aar ' // AutoFitTextView compile 'me.grantland:autofittextview:0.2.+' // RoundedImageView compile 'com.makeramen:roundedimageview:2.2.0' // UpdateChecker compile 'com.github.rampo.updatechecker:library:2.1.8' // UniversalImageLoader compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' // GifDrawable compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+' // PieChart compile 'com.github.PhilJay:MPAndroidChart:v2.2.4' compile 'com.android.support:support-v13:+' compile('com.crashlytics.sdk.android:crashlytics: 2.5.5@aar ') { transitive = true; } //AndroidSlidingUpPanel compile 'com.sothree.slidinguppanel:library:3.3.0' // YPL compile 'com.X:Xandroidlibrary:1.4.0' compile project(':kdcreader') } 

And here is the Gradle Console

Tasks: [: app: assembleDebug]

On-demand configuration is an incubation function. WARNING: WARNING: Dependency org.apache.httpcomponents: httpclient: 4.3.5 is ignored for debugging, as this may contradict the internal version provided by Android. If a problem occurs, repackage it with jarjar to modify the class packages. WARNING: WARNING: Dependency org.apache.httpcomponents: httpclient: 4.3.5 is ignored for debugging, as it may contradict the internal version provided by Android. If a problem occurs, repackage it with jarjar to modify the class packages. WARNING: WARNING: Dependency org.apache.httpcomponents: httpclient: 4.3.5 is ignored for release as it may conflict with the internal version provided by Android. If a problem occurs, repackage it with jarjar to modify the class packages. WARNING: WARNING: Dependency org.apache.httpcomponents: httpclient: 4.3.5 is ignored for release as it may conflict with the internal version provided by Android. In case of a problem, repack it with jarjar to change class packages: app: preBuild UP-TO-DATE: app: preDebugBuild UP-TO-DATE: application: checkDebugManifest: application: preReleaseBuild UP-TO-DATE: app: prepareComAndroidSupportAppcompatV72311Library TO-DATE: app: preDebugAndroidTestBuild UP-TO-DATE: app: prepareComAndroidSupportMultidex101Library UP-TO-DATE: app: prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE: app: prepareComAndroidSupportSuppibComtib25 : prepareComAndroidSupportSupportCoreUtils2510Library UP-TO-DATE: app: prepareComAndroidSupportSupportFragment2510Library UP-TO-DATE: application: prepareComAndroidSupportSupportMediaCompat2510Library UP-TO-DATE: app: prepareComAndroidS32ibS5 UP-TO-DATE: app: prepareComAndroidSupportSupportV42510Library UP-TO-DATE: app: prepareComCrashlyticsSdkAndroidAnswers136Library UP-TO-DATE: application: prepareComCrashlyticsSdkAndroidBeta114Library UP-TO-DATE: app: prepareComCrashlyticsSdkAndroidCrashlytics255Library UP-TO-DATE: Appendix: prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library UP-TO-DATE : application: prepareComDaimajiaNumberprogressbarLibrary12Library UP-TO-DATE: application: prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE: application: prepareComGetkeepsafeRelinkerRelinker122Library UP-TO-DATE: application: prepareComGithubNirhartParallaxscroll10Library UP-TO-DATE: application: prepareComGithubRampoUpdatecheckerLibrary218Library UP-TO-DATE: application: prepareComMakeramenRoundedimageview220Library UP -TO-DATE: application: prepareComSothreeSlidinguppanelLibrary330Library UP-TO-DATE: application: prepareComX Xnandroidlibrary140Library UP-TO-DATE: application: prepareIoFabricSdkAndroidFabric1310Library UP-TO-DATE: app: prepareIoRealmAndroidAdapters121Library UP-TO-DATE: app: prepareIoRealmRealmAndroidLibrary211Library UP-TO-DATE: app: prepareMeDm7BarcodescannerCore19Library UP-TO-DATE: app: prepareMeDm7BarcodescannerZbar19Library UP-TO- DATE: app: prepareMeGrantlandAutofittextview021Library UP-TO-DATE: app: preparePlDroidsonroidsGifAndroidGifDrawable1117Library UP-TO-DATE: app: prepareSeEmilsjolanderStickylistheaders270Library UP-TO-DATE: app: prepareDebDenDugDenDugDebdebid compendebugs compile : application: generateDebugBuildConfig UP-TO-DATE: application: mergeDebugShaders UP-TO-DATE: application: compileDebugShaders UP-TO-DATE: application: generateDebugAssets UP-TO-DATE: application: mergeDebugAssets UP-TO-DATE: application: processDebugManif -TO-DATE: app: fabricGenerateR esourcesDebug: app: generateDebugResValues ​​UP-TO-DATE: app: generateDebugResources: app: mergeDebugResources: app: processDebugResources: app: generateDebugSources: app: incrementalDebugJavaCompilationSafeguard UP-TO-DATE: app: compileDebDugDavaDavaDavaDavaJava app TO-DATE: application: compileDebugSources UP-TO-DATE: app: transformClassesWithRealmTransformerForDebug UP-TO-DATE: application: transformClassesWithJarMergingForDebug UP-TO-DATE: app: transformClassesWithMultidexlistForDebug FAILED

FAILURE: build failed with exception.

  • What went wrong: Execution failed for task ': app: transformClassesWithMultidexlistForDebug'.

    java.lang.UnsupportedOperationException (no error message)

  • Try it: run with the -stacktrace option to get a stack trace. Run with the -info or --debug option to get more log output.

STRICTLY MALFUNCTIONAL

Total time: 5.277 seconds

[EDIT] And more crash info: http://pastebin.com/vG79DLuN

Thanks for your help!

+6
source share
1 answer

I had the same problem. In my application, I use the guava-retrying library, which retrieved the google version of guava library version 21 . Guava 21 requires JDK 1.8 without support for reverse port support, and this caused this error in my case.

I managed to solve this problem by turning on the guava-retrying library so that it would use version 19.0 of the guava library:

 compile ("com.github.rholder:guava-retrying:2.0.0") { exclude group: 'com.google.guava', module: 'guava' } compile 'com.google.guava:guava:19.0' 
+4
source

Source: https://habr.com/ru/post/1013349/


All Articles