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

Storage: Dependency issue: Could not find androidx.annotation:annotation:1.1.0 #148

Closed
jnizet opened this issue Feb 26, 2020 · 8 comments
Closed
Assignees
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jnizet
Copy link

jnizet commented Feb 26, 2020

Environment details

  1. API: Storage
  2. OS: macOS 10.15.2
  3. Java version: 1.8.0_152
  4. storage version(s): 1.104.0

Steps to reproduce

Create a gradle-based project with these (gradle 6.2):

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    implementation("com.google.cloud:google-cloud-storage:1.104.0")
}

Build it.

The build fails with

Could not find androidx.annotation:annotation:1.1.0.
     Required by:
         project :backend > com.google.cloud:google-cloud-storage:1.104.0 > com.google.api-client:google-api-client:1.30.8

Not sure if this dependency should exist in the first place. But if it should exist, then it should also be published to the repositories where google-cloud-storage is published. Or at the very least, the README should indicate if/when the dependency can be excluded and/or which repository to add to be able to use google-cloud-storage

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Feb 26, 2020
@suraj-qlogic
Copy link
Contributor

@jnizet please try below config

repositories {
    google()
    jcenter()
}

dependencies {
    implementation("com.google.cloud:google-cloud-storage:1.104.0")
}

@pmakani pmakani added the type: question Request for information or clarification. Not an issue. label Feb 26, 2020
@jnizet
Copy link
Author

jnizet commented Feb 26, 2020

@suraj-qlogic thanks, that works fine.

But still, I shouldn't have to do that, IMHO. This is why I submitted this issue (which IMHO, is an issue, and not just a question).

Why is a generic Java library dependant on what seems to be, according to its name, android-specific annotations?
If those annotations are supposed to be in the dependencies of an artifact published on Maven central, why aren't they also published on Maven central?
If the google repo is necessary, why isn't it documented in the README?

@gregorbg
Copy link

I am experiencing the exact same issue, basically +1 everything @jnizet said.

I'm also astonished that this issue occurs when bumping from 1.103 (no error) to 1.104 (error as described above). The minor version bump does not imply to me that repositories {} block should be updated.

@frankyn
Copy link
Contributor

frankyn commented Feb 28, 2020

@chingor13 it looks like a dependency was added into api-client that's only available in Google maven repository. Do you have more information?

@frankyn frankyn added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed type: question Request for information or clarification. Not an issue. labels Feb 28, 2020
@chingor13
Copy link
Contributor

chingor13 commented Feb 28, 2020

cc @elharo

I think this was fixed upstream but I need to do a release for it.

@elharo
Copy link
Contributor

elharo commented Feb 28, 2020

I'm still not convinced this was a bug, though there is a lot of failure in tools here because it exercised some parts of the Maven pom.xml that weren't well designed and/or correctly implemented.

Regardless, changes have been committed that will avoid this for now. I don't think @chingor13 has released those yet.

@elharo elharo closed this as completed Feb 28, 2020
@frankyn
Copy link
Contributor

frankyn commented Feb 28, 2020

@elharo what are the changes users should be waiting for?

@elharo
Copy link
Contributor

elharo commented Feb 28, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

7 participants