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

Building Robolectric fails at jitpack.io #8742

Open
nikclayton opened this issue Jan 12, 2024 · 0 comments
Open

Building Robolectric fails at jitpack.io #8742

nikclayton opened this issue Jan 12, 2024 · 0 comments

Comments

@nikclayton
Copy link

Description

This is a companion bug to jitpack/jitpack.io#6077

I'm trying to use Jitpack to build a version of Robolectric pinned to a specific commit (rather than a moving snapshot). I'm trying to do this because I need a Robolectric build that I can use in my project's CI that has the fix for #8469.

However, Jitpack can't build Robolectric.

Steps to Reproduce

  1. Take any Android project that currently uses Robolectric, and follow the instructions at https://jitpack.io/#robolectric/robolectric to modify the list of repositories to include https://jitpack.io.
  2. Change the project's Robolectric dependency to
implementation 'com.github.robolectric:robolectric:0bb4e8f50766532d98955fe5e66d07c0f7b4e5cf'

(that commit ref is the current HEAD).

  1. Try and build the Android project. It will fail, because Jitpack can't build Robolectric at the current HEAD.

The Jitpack build log for this build is https://jitpack.io/com/github/robolectric/robolectric/0bb4e8f507/build.log, and it reports (this is an excerpt, see that link for the full contents):

...
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of null.
> Could not resolve all task dependencies for configuration ':buildSrc:buildScriptClasspath'.
   > Could not resolve project :buildSrc.
     Required by:
         project :buildSrc
      > No matching variant of project :buildSrc was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.3' but:
          - Variant 'apiElements' capability :buildSrc:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
          - Variant 'mainSourceElements' capability :buildSrc:unspecified declares a component, and its dependencies declared externally:
              - Incompatible because this component declares a component of category 'verification' and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
                  - Doesn't say anything about its usage (required runtime)
          - Variant 'runtimeElements' capability :buildSrc:unspecified declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
          - Variant 'testResultsElementsForTest' capability :buildSrc:unspecified:
              - Incompatible because this component declares a component of category 'verification' and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
                  - Doesn't say anything about its usage (required runtime)
...

I'm not sure if this is a Jitpack issue (which is why I reported it there) or a Robolectric issue (which is why I'm reporting it here too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant