ansman/kotshi

Execution failed for task ':app:kaptGenerateStubsDebugKotlin' error on androidX

nksaroj opened this issue · 4 comments

Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
I am getting the above error when migrated to androidX with com.android.tools.build:gradle:3.2.0-rc02.
To reproduce the issue please build the app under https://github.com/nksaroj/xDemo with Android Studio RC2

Please use the command line
./gradleW aDebug

I can't build the project you reference, it fails with this error:

> Task :app:kaptGenerateStubsDebugKotlin FAILED
ERROR: [TAG] Failed to resolve variable '${animal.sniffer.version}'


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
> Could not resolve all files for configuration ':app:kapt'.
   > Failed to transform file 'org.eclipse.jdt.core-3.10.0.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
      > Failed to transform '/Users/nicklas/.gradle/caches/modules-2/files-2.1/org.eclipse.jdt/org.eclipse.jdt.core/3.10.0/647e19b28c106a63a14401c0f5956289792adf2f/org.eclipse.jdt.core-3.10.0.jar' using Jetifier. Reason: The type does not support '.' as package separator! Received 'java.lang.Object;Ljava.lang.Class'.. (Run with --stacktrace for more details.) To disable Jetifier, set android.enableJetifier=false in your gradle.properties file.

If I disable the jettifier it compiles as expected.

Yes, that build error is my problem too...
It's suggested to set android .enableJetifier=true for androidX migration.
When I commented out the following lines the build error disappears .

    compile("se.ansman.kotshi:api:1.0.4")
    kapt ("se.ansman.kotshi:compiler:1.0.4")

Don't you think then issue then related to kapt plugin for kotshi compiler?

The problem seems to be for the Jettifier. It can't process org.eclipse.jdt.core-3.10.0.jar properly. This should be filed with the AndroidX team.

OK, I will file a bug against android