Exception on RUN APP AS 3.01 re: DesugarForDebug RESOLVED

53 Views Asked by At

Problem resolved rather than solved. After quite a bit of trouble shooting I could not resolve this problem. My resolution was to start upgrading Android Studio until the problem changed or went away. Finally the problem for the most part went away when I got to Version 4.2 of Android studio. All of the version 3 upgrades I tried did not improve the situation. The version 4.2 does a very thorough update deleting all previous directories. It also updated the gradle versions in my code. This resulted in a fully functioning build and run that is going to allow me to advance my work. Thanks to those of you that showed an interest. I hope this resolution helps someone else get past Desugard Dex errors that I struggled with.

Not sure how to update this to answered or solved. Please advise.

Original Problem. I have imported some old code into a fresh install of AS 3.01 to get me back to an operational version to add new features and upgrade version where required. The code seems to build fine but fails on Run or make APK I have tried lots of things from similar questions posted here and have updated dependencies where I could without introducing a ton of new errors. This error has been pretty consistent along with DEX errors. I have updated the materials: to 1.6.0 but can not get to 1.11.0 as I get Unsupported type 'macro' errors in values.xml which I do not understand except I think it may also be a depreciation. I have stalled on this one and could use some help. With thanks. So grateful to this forum for problems already solved over the years.

I have tried the most recent Android Studio which was a disaster, tons of errors due to depreciations etc. So went back to 3.01 I have tried a number of different gradle versions 3x 4x and 6x. Most of the changes introduce new errors and I have either found solutions or have had to backtrack. I have cleaned after every edit and also have been invalidating cache and restarting regularly.

I just want to get it back to where it will build and run so I can update the app in a more recent environment. It was working fine when it reached a good enough operational requirement afew years ago. It now needs more work. My comfort level is getting what worked before working with as few changes as possible. There have been a lot of depreciations since I developed this a few years back and would prefer to deal with them one at a time. I have started working on a second machine to bring the version up from 3.01 to something closer to the present without breaking anything to much. I am starting with 3.32 and will continue up the ladder hoping that my issue above may get resolved by aligning versions. Any suggestion on this path appreciated.

#Fri Feb 16 08:33:15 PST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
apply plugin: 'com.android.application'

android {
    compileSdkVersion 31
    //supportLibVersion = "27.1.1"
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "ca.divemaster.obd2app"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
       /* dexOptions {
            preDexLibraries = false
        }*/
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }

}
repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-annotations:28.0.0'
    testImplementation 'junit:junit:4.13.2'
    //androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    //androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    /*androidTestImplementation ("androidx.test.ext:truth:1.1.0") {
        exclude group: "com.google.truth", module: "truth"
    }

    androidTestImplementation ("com.google.truth:truth:0.44") {
        exclude group: "org.checkerframework", module: "checker-compat-qual"
        exclude group: "com.google.errorprone", module: "error_prone_annotations"
    }
    */
    implementation 'com.macroyau:blue2serial:0.1.5'
    implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
    implementation 'com.google.code.gson:gson:2.10'
    //implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.jjoe64:graphview:4.2.2'
    implementation 'com.android.support:support-annotations:28.0'
   
}
Executing tasks: [:app:assembleDebug]

:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:packageInstantRunResourcesDebug UP-TO-DATE
:app:checkManifestChangesDebug
:app:extractTryWithResourcesSupportJarDebug UP-TO-DATE
:app:transformClassesWithStackFramesFixerForDebug UP-TO-DATE
:app:transformClassesWithDesugarForDebug
Exception in thread "main" java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at com.google.devtools.build.android.desugar.CoreLibraryRewriter.reader(CoreLibraryRewriter.java:44)
    at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:388)
    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)


 FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:
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 {@C:\app\obd2app3\app\build\intermediates\tmp\desugar_args6362282480250041760}

* Try:
0

There are 0 best solutions below