title: Error while building android app
body: <p>Application is being configured to use Room library, meanwhile studio requested for updating build numbers of support libraries and stopped at this error.</p>
  
  <p>The log also has a warning for using java 8 as room-compiler uses only  Java 7 for processing. But, that has to be fine!!</p>
  
  <p>App in not being built due to following issue:</p>
  
  <pre><code>Error:Exception in thread "main" java.lang.IllegalArgumentException
  at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
  at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
  at org.objectweb.asm.ClassReader.accept(Unknown Source)
  at org.objectweb.asm.ClassReader.accept(Unknown Source)
  at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
  at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
  at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
  at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
  at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
  at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
  at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
  at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
  at org.objectweb.asm.ClassReader.accept(Unknown Source)
  at org.objectweb.asm.ClassReader.accept(Unknown Source)
  at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
  at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
  at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
  at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:transformClassesWithDesugarForStagingDebug'.
  &gt; com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@E:\Code\Android\Slave\VendorApp\Kwik24\app\build\intermediates\tmp\desugar_args2042478892032008870}
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 4s
  Exception in thread "main" java.lang.IllegalArgumentException
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
      at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
      at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
      at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
  
  Exception in thread "main" java.lang.IllegalArgumentException
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
      at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
      at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
      at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
  
  Exception in thread "main" java.lang.IllegalArgumentException
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
      at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at org.objectweb.asm.ClassReader.accept(Unknown Source)
      at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
      at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
      at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
      at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
  `
  </code></pre>
  
  <p>App gradle file</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  
  android {
      compileSdkVersion 26
      buildToolsVersion '26.0.2'
      defaultConfig {
          applicationId "**************"
          minSdkVersion 15
          targetSdkVersion 22
          versionCode 16
          versionName "2.3"
          multiDexEnabled true
      }
  
  compileOptions {
              sourceCompatibility JavaVersion.VERSION_1_8
              targetCompatibility JavaVersion.VERSION_1_8
          }
  
  signingConfigs {
      release {
  
      }
      debug {
          storeFile file('../../debug.keystore')
      }
  }
  
  flavorDimensions "default"
  
  productFlavors { ******************************* }
  dexOptions {
      javaMaxHeapSize "4g"
  }
  buildTypes {
      release {
          signingConfig signingConfigs.release
          minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
  //        debug{
  //            minifyEnabled true
  //            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  //        }
      }
  }
  
  repositories {
      maven { url "https://jitpack.io" }
      mavenCentral()
      maven { url 'https://maven.fabric.io/public' }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support.constraint:constraint-layout:1.0.2'
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:support-annotations:26.1.0'
      compile 'com.android.support:appcompat-v7:26.1.0'
      compile 'com.android.support:design:26.1.0'
      compile 'com.android.support:recyclerview-v7:26.1.0'
      compile 'com.android.support:cardview-v7:26.1.0'
      compile 'com.android.support:support-core-utils:26.1.0'
      compile 'com.android.support:design:26.1.0'
      compile 'com.koushikdutta.async:androidasync:2.+'
      compile 'com.koushikdutta.ion:ion:2.+'
      compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
      compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
          transitive = true;
      }
      compile 'com.android.support:multidex:1.0.1'
      compile 'com.firebaseui:firebase-ui-auth:3.2.1'
      compile 'com.google.android.gms:play-services:11.0.4'
  //new libraries
  compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
  compile 'io.reactivex.rxjava2:rxjava:2.1.7'
  //data persistence, android architecture library - Room
  implementation 'android.arch.persistence.room:runtime:1.0.0'
  annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
  implementation "android.arch.lifecycle:common-java8:1.1.0"
  implementation "android.arch.persistence.room:rxjava2:1.0.0"
  
      }
  
  
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>Project gradle build:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
          maven {
              url "https://maven.google.com"
          }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
          classpath 'com.google.gms:google-services:3.1.0'
      }
  }
  
  allprojects {
      repositories {
          jcenter()
          google()
          maven {
              url "https://maven.google.com"
          }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>