1

I add the following dependency in my build.gradle file

compile 'javax.json.bind:javax.json.bind-api:1.0.0-M2' it throws the error like

Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.

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 {--input /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/11.jar --output /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/desugar/debug/10.jar --input /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/6.jar --output /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/desugar/debug/5.jar --input /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/19.jar --output /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/desugar/debug/18.jar --input /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/18.jar --output /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/desugar/debug/17.jar --input /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/26.jar --output /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/desugar/debug/21.jar --input /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/4.jar --output /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/desugar/debug/3.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/classes/debug --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/0.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/3.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/4.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/5.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/6.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/7.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/8.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/9.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/10.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/11.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/12.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/13.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/14.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/15.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/16.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/17.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/18.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/19.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/20.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/21.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/26.jar --classpath_entry /Users/panmoh/Documents/AndroidMockUps/app/build/intermediates/transforms/stackFramesFixer/debug/27.jar --bootclasspath_entry /Users/panmoh/Library/Android/sdk/platforms/android-26/android.jar --bootclasspath_entry /Users/panmoh/Library/Android/sdk/platforms/android-26/optional/org.apache.http.legacy.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/resources.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/rt.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/jsse.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/jce.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/charsets.jar --min_sdk_version 15 --desugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}

This my build.gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.canwin.androidmockups"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.uncopt:android.justified:1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'

}
Mohanraj
  • 296
  • 2
  • 13

2 Answers2

2

I used the following in my build.gradle file:

implementation group: 'javax.json.bind', name: 'javax.json.bind-api', version: '1.0'

Damien Cooke
  • 599
  • 10
  • 20
0

Go to this link and download jar file then add in your project folder inside app->libs folder..Then syn you project

https://mvnrepository.com/artifact/javax.json.bind/javax.json.bind-api/1.0.0-M2

Solution 2:

Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.

com.android.build.api.transform.TransformException: 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

Open your build.gradle and use below

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"

Then Clean-Rebuild-Run .

Gowthaman M
  • 8,057
  • 8
  • 35
  • 54
  • Just clear and rebuild once...i think `compile 'javax.json.bind:javax.json.bind-api:1.0.0-M2'` no need of this line..,Means **lib** itself it will take own.... – Gowthaman M Apr 26 '18 at 07:14
  • i remove compile 'javax.json.bind:javax.json.bind-api:1.0.0-M2' and also clear and rebuild project again it throws same... – Mohanraj Apr 26 '18 at 07:26
  • make sure **removecompile 'javax.json.bind:javax.json.bind-api:1.0.0-** After that Restart you Android Studio...like **File->Invalidated/caches**...might chance is there your project is not syn properly...let me know once you done – Gowthaman M Apr 26 '18 at 07:29
  • Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'. Getting runtime from message gradle build toolbar – Mohanraj Apr 26 '18 at 09:07
  • android { compileSdkVersion 26 defaultConfig { applicationId "com.example.canwin.androidmockups" minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName "1.0" multiDexEnabled = true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } compileOptions { targetCompatibility 1.8 sourceCompatibility 1.8 } } – Mohanraj Apr 26 '18 at 10:24
  • is this okay or not? – Mohanraj Apr 26 '18 at 10:25
  • @Mohanraj can you post your complete build.gradle in your question so that i can check...screen shot is more enough – Gowthaman M Apr 26 '18 at 10:29