google / ksp

Kotlin Symbol Processing API
https://github.com/google/ksp
Apache License 2.0
2.88k stars 272 forks source link

Cannot resolve AGP version with KSP `2.x-1.0.25` #2110

Open sgammon opened 1 month ago

sgammon commented 1 month ago

On both KSP 2.0.20-1.0.25 and 2.1.0-Beta1-1.0.25, with AGP 8.7.0-beta02:

* What went wrong:
Could not determine the dependencies of task ':commons:ux:kspAndroidMain'.
> Could not resolve all dependencies for configuration ':commons:ux:androidCompileClasspath'.
   > The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :commons:model:
       - Configuration ':commons:model:androidApiElements' variant android-classes-jar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-classes-jar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:model:androidApiElements' variant android-lint declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-lint' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:model:androidApiElements' variant android-lint-local-aar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-lint-local-aar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:model:androidApiElements' variant android-manifest declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-manifest' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:model:androidApiElements' variant jar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'jar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
   > The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :commons:logging:
       - Configuration ':commons:logging:androidApiElements' variant android-classes-jar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-classes-jar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:logging:androidApiElements' variant android-lint declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-lint' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:logging:androidApiElements' variant android-lint-local-aar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-lint-local-aar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:logging:androidApiElements' variant android-manifest declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-manifest' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:logging:androidApiElements' variant jar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'jar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
   > The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :commons:extension:
       - Configuration ':commons:extension:androidApiElements' variant android-classes-jar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-classes-jar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:extension:androidApiElements' variant android-lint declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-lint' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:extension:androidApiElements' variant android-lint-local-aar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-lint-local-aar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:extension:androidApiElements' variant android-manifest declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'android-manifest' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
       - Configuration ':commons:extension:androidApiElements' variant jar declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0-beta02', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
           - Unmatched attributes:
               - Provides attribute 'artifactType' with value 'jar' but the consumer didn't ask for it
               - Provides its elements packaged as a jar but the consumer didn't ask for it
sgammon commented 1 month ago

cc / @ting-yuan i built the libs ahead of release. i know they are already on their way

ting-yuan commented 1 month ago

Would you mind to give the nightly build a try? It would be also super helpful if you could share a test case.

sgammon commented 1 month ago

@ting-yuan At that URL, I get a Google internal SSO page... is that intended?

sgammon commented 1 month ago

@ting-yuan I found the snapshots repository, but, I'm sad to say I get the same result. I'd paste it here but the output seems identical.

Worth noting that we are now on AGP stable as well (8.7.0). Respectfully, we really need a release at 1.0.24 that works with 2.1.0-Beta1, or otherwise a fix for this, because it is blocking critical fixes we need in the Kotlin compiler. As you know, KSP enforces Kotlin/KSP version compatibility. If this is a choice you guys intend to keep (it's sensible, I get it), then a release at each version matrix entry between the two is only fair.

sgammon commented 1 month ago

@ting-yuan Same result on 2.0.21-RC-1.0.25...

joffrey-bion commented 1 month ago

@sgammon where did you find the SNAPSHOTs repository, by the way? I'm trying to verify if some issues with KMP/Native will be fixed in 2.x-1.0.26

kuanyingchou commented 1 month ago

Hi, @joffrey-bion, you can find it here: https://github.com/google/ksp?tab=readme-ov-file#nightly-builds

joffrey-bion commented 1 month ago

Oh thanks! I somehow missed it