Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not resolve project -> when a submodule is aar artifact #1176

Closed
brianPlummer opened this issue Apr 23, 2024 · 3 comments
Closed

Could not resolve project -> when a submodule is aar artifact #1176

brianPlummer opened this issue Apr 23, 2024 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists toolchain:android

Comments

@brianPlummer
Copy link

Build scan link

Plugin version
1.31.0

Gradle version
8.7

JDK version
17.0.6

(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version
1.9.23

(Optional) Android Gradle Plugin (AGP) version
8.3.2

Describe the bug
./gradlew app:projectHealth produces the output:

Could not determine the dependencies of task ':selfprofile:transformReleaseClassesWithAsm'.
> Could not resolve all task dependencies for configuration ':selfprofile:releaseRuntimeClasspath'.
   > Could not resolve project :laboratory-lib.
     Required by:
         project :selfprofile
         project :selfprofile > project :core-ui
         project :selfprofile > project :core-data
         project :selfprofile > project :core-common
      > The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.3.2', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :laboratory-lib:
          - projectHealthElements
          - resolvedDepsElements
        All of them match the consumer attributes:
          - Variant 'projectHealthElements' capability Foo:laboratory-lib:unspecified:
              - Unmatched attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.3.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about its usage (required runtime)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                  - Provides attribute 'dagp.internal.artifacts' with value 'project-health' but the consumer didn't ask for it
          - Variant 'resolvedDepsElements' capability Foo:laboratory-lib:unspecified:
              - Unmatched attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.3.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about its usage (required runtime)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                  - Provides attribute 'dagp.internal.artifacts' with value 'resolved-deps' but the consumer didn't ask for it

To Reproduce
Create a project with a submodule that is just an aar wrapper. With a build.gradle.kts like

configurations.maybeCreate("default")
artifacts.add("default", file("some.aar"))

Expected behavior
./gradlew app:projectHealth should output the health report

@autonomousapps autonomousapps added bug Something isn't working toolchain:android labels May 1, 2024
@autonomousapps
Copy link
Owner

Thanks for the report. Do you have a minimal reproducer?

@Kernald
Copy link

Kernald commented May 9, 2024

While I don't have a minimal reproducer, I'm facing a similar issue which seems to be a regression in 1.28.0 onwards - I tested (successfully) 1.25.0, 1.26.0 and 1.27.0, and faced the issue with both 1.28.0, 1.29.0, 1.30.0 and 1.31.0.

@autonomousapps
Copy link
Owner

This duplicates #1108. Closing in favor of the latter (I have a workaround posted there).

@autonomousapps autonomousapps added duplicate This issue or pull request already exists and removed more information needed labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists toolchain:android
Projects
None yet
Development

No branches or pull requests

3 participants