UnifiedPush / android-connector

Mirror of https://codeberg.org/UnifiedPush/android-connector/
Apache License 2.0
35 stars 8 forks source link

CIRCULAR REFERENCE: com.android.tools.r8.kotlin.H #81

Closed konradmoesch closed 11 months ago

konradmoesch commented 11 months ago

I tried adding the android-connector library to the mastodon-android gradle files as per https://unifiedpush.org/developers/android/ However, I am unable to build the project. I get CIRCULAR REFERENCE: com.android.tools.r8.kotlin.H My changes are pretty simple so far. Changes can be found here: https://github.com/konradmoesch/mastodon-android/commit/d21008d5e3c7b17186cfd02012275639b1e7bdbe

error log:

> Task :mastodon:mergeExtDexDebug
AGPBI: {"kind":"error","text":"com.android.tools.r8.kotlin.H","sources":[{}],"tool":"D8"}
com.android.tools.r8.kotlin.H

AGPBI: {"kind":"error","text":"com.android.tools.r8.kotlin.H","sources":[{}],"tool":"D8"}

> Task :mastodon:mergeExtDexDebug FAILED
Execution failed for task ':mastodon:mergeExtDexDebug'.
> Could not resolve all files for configuration ':mastodon:debugRuntimeClasspath'.
   > Failed to transform android-connector-2.2.0.aar (com.github.UnifiedPush:android-connector:2.2.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: /home/km/.gradle/caches/transforms-3/5a9184e11a929640a46f8b4374be810e/transformed/android-connector-2.2.0-runtime.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-1.9.10.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.10) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: /home/km/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar.
         > Error while dexing.

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':mastodon:mergeExtDexDebug'.
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
    [.....](shortened for the issue)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Cause 1: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform android-connector-2.2.0.aar (com.github.UnifiedPush:android-connector:2.2.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
    at org.gradle.api.internal.artifacts.transform.TransformingAsyncArtifactListener$TransformedArtifact.lambda$visit$2(TransformingAsyncArtifactListener.java:232)
    [.....](shortened for the issue)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Execution failed for DexingNoClasspathTransform: /home/km/.gradle/caches/transforms-3/5a9184e11a929640a46f8b4374be810e/transformed/android-connector-2.2.0-runtime.jar.
    at org.gradle.api.internal.artifacts.transform.DefaultTransformerInvocationFactory$1.lambda$mapResult$3(DefaultTransformerInvocationFactory.java:159)
    [.....](shortened for the issue)
    at org.gradle.internal.execution.steps.IdentityCacheStep.lambda$executeDeferred$1(IdentityCacheStep.java:47)
    ... 25 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
    at Version.fakeStackEntry(Version_4.0.52.java:0)
    [.....](shortened for the issue)
    ... 115 more
Caused by: com.android.tools.r8.kotlin.H
    at com.android.tools.r8.kotlin.j.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:42)
    [.....](shortened for the issue)
    at com.android.tools.r8.internal.vk.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:24)
    ... 118 more
    Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.kotlin.H
        at com.android.tools.r8.D8.d(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:174)
        [.....](shortened for the issue)
        at java.base/java.lang.Thread.run(Thread.java:833)
    Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.kotlin.H
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566)
        [.....](shortened for the issue)
        at com.android.tools.r8.D8.d(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:154)
        ... 125 more
    Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.kotlin.H]
Cause 2: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform kotlin-stdlib-1.9.10.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.10) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
    at org.gradle.api.internal.artifacts.transform.TransformingAsyncArtifactListener$TransformedArtifact.lambda$visit$2(TransformingAsyncArtifactListener.java:232)
    [.....](shortened for the issue)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Execution failed for DexingNoClasspathTransform: /home/km/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar.
    at org.gradle.api.internal.artifacts.transform.DefaultTransformerInvocationFactory$1.lambda$mapResult$3(DefaultTransformerInvocationFactory.java:159)
    [.....](shortened for the issue)
    at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.run(DefaultBuildOperationQueue.java:191)
    ... 5 more
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
    at com.android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.java:183)
    [.....](shortened for the issue)
    at org.gradle.internal.execution.steps.IdentityCacheStep.lambda$executeDeferred$1(IdentityCacheStep.java:47)
    ... 28 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
    at Version.fakeStackEntry(Version_4.0.52.java:0)
    [.....](shortened for the issue)
    at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:120)
    ... 120 more
Caused by: com.android.tools.r8.kotlin.H
    at com.android.tools.r8.kotlin.j.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:42)
    [.....](shortened for the issue)
    at com.android.tools.r8.internal.vk.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:24)
    ... 123 more
    Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.kotlin.H
        at com.android.tools.r8.D8.d(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:174)
        ... 125 more
    Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.kotlin.H
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566)
        [.....](shortened for the issue)
        at com.android.tools.r8.D8.d(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:154)
        ... 125 more
    Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.kotlin.H]
konradmoesch commented 11 months ago

Fixed by upgrading gradle to 8.2.0