ansman/kotshi

Unable to build project with Jetifier enabled (2.0.2)

Closed this issue · 1 comments

Hello, I'm unable to build our project which uses Dagger and AndroidX, Jetifier seems to point out that this library has an issue.

Exception:


* What went wrong:
Execution failed for task ':app:mergeDexRelease'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Failed to transform artifact 'api.jar (se.ansman.kotshi:api:2.0.2)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=false, dexing-min-sdk=16, org.gradle.usage=java-runtime-jars}.
      > No variants of org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.30 match the consumer attributes:
          - org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.30:
              - Incompatible attribute:
                  - Required artifactType 'android-classes' and found incompatible value '7b3e4da2'.
              - Other attributes:
                  - Required dexing-enable-desugaring 'true' but no value provided.
                  - Required dexing-is-debuggable 'false' but no value provided.
                  - Required dexing-min-sdk '16' but no value provided.

For some reason, it seems to be complaining about kotlin attributes, however I can run the project if I try to debug it with "Run" option on Android Studio. This only happens when I try to get either a release or a debug build, minified or not.

What I've tried so far:

  • The usual cleaning, rebuilding (which both work), invalidating & restarting, removing the build, .gradle and .idea folders,

  • Adding android.jetifier.blacklist=api-2.0.2,api,api-2.0.2-sources,kotshi,kotshi-api and all of them individually as one parameter only to blacklist to see if Jetifier actually skips (it doesn't, still fails)

  • Removing the library which left me with another error that I couldn't find any information from:
    ERROR: Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jdk7:org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension_Decorated

I'm not even sure if the issue comes from this library itself anymore, but I need to resolve this. Any help would be appreciated, thanks.

Never mind, I just updated the kotlin plugin from Android Studio itself which worked for me. Apparently some old version was used in it.