-
Notifications
You must be signed in to change notification settings - Fork 703
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
Unresolvable dependency after 1.30.8 #1487
Comments
#1467 looks like it introduced a dependency that exists in Google's Android Maven repository. I'm not sure that we should have taken this dependency as it seems to force all downstream users to add a Maven repository. As a workaround, you can add |
There was a very specific bug fixed by this change. We can explore other options but I don't think requiring that repository is as bad as the bug it fixes. |
This seems to be only affecting ivy and not Maven or gradle users. Please try adding the additional Maven repository url. |
Will there be a permanent fix for this or will manually adding the additional repository be permanently required? Although Ivy is not as common as Maven, it is still a mainstream dependency manager and this is the only library we have encountered (as of 1.30.8) that fails to work "out of the box". Our application is not used with Android, so ideally we would not be required to pull in any extra Android dependencies. |
Unless we find new information, this is not a bug. The Maven repository system was always meant to be multi-repo. There is no expectation that all dependencies be loaded from Maven Central. and it sounds like Ivy can indeed resolve this dependency with a simple modification to the build.xml or ivy-settings.xml file. I don't know why Android chooses not to upload their artifacts to Maven Central. You could ask them to do so. However we do support android in this library, and that does require us to use this dependency. |
@elharo Shouldn't androidx.annotation:annotation only be a build/compile time dependency though? I don't think these annotations are needed at runtime, so consumers of google-api-java-client shouldn't need to pull in the additional dependency. |
Java's default retention policy is CLASS, and I think that's what androidx.annotation.keep has. However, Maven doesn't have a real compileOnly dependency scope like Gradle does. compile scope in Maven is available at runtime. Perhaps we could make this provided or |
The issue was reproduced with a gradle build after migration from 1.30.3 to 1.30.8:
The build can be fixed by adding 'google()` repository. However, it's incorrect fix. Nobody will expect to add a new repository for such things: either move the androidx.annotation to maven central repository ( |
We're not going to remove the dependency. It's necessary to make this library work on Android, which is a requirement. You can ask the android team to publish this artifact on Maven Central. I don't know why they don't. |
Given that it's also necessary to make this library work on not-Android, could you at least update your installation instructions in your
The frustration here is that, for many build systems, the only way to discover this dependency is to attempt to build and find it is not able to build. |
I would prefer not to add the dependency, but given the stuborness that the dependency must be there... may I suggest that semantic versioning is thus broken and you should definitely increase at least the minor number? Something that breaks the build should most certainly NOT be a patch only increase. |
I am not sure this is something semver considered. There are no API changes here, at all. This change was a bug fix, nothing more. Per semver that's a patch release. |
Maybe not by the letter of the semver law, but the change breaks every single downstream build, and that fact is barely being acknowledged, at least a semver minor change says: "be careful, expect build to break" |
This appears to be a deliberate design decision in Gradle to not consider repositories declared in the pom "Maven POM metadata can reference additional repositories. These will be ignored by Gradle, which will only use the repositories declared in the build itself. |
Everything worked normally till ivy + 1.30.7 and now we see the mentioned issue since ivy + 1.30.8. |
tl;dr Sent #1491 which I think should make everyone happy. But I see more issues here than just a POM file so let me provide some opinion. Since this is a library for developers, shouldn't developer experience be a higher priority than philosophy regarding how maven or gradle should work? I think you'd be hard pressed to find even one other library on Maven Central that requires resolving artifacts from a separate repository. In fact, it's strongly discouraged by Maven Central http://maven.apache.org/repository/guide-central-repository-upload.html It's true that Google's isn't a "sketchy" repository, but keeping builds simple and easy to reason about is likely just as much a motivation for this recommendation. Requiring Gradle users to add an additional repository primarily for Android to non-Android Java builds will make them slower (more repositories to resolve from) and confusing (the README change only adds a single line, But anyways, the problem here can be solved without affecting user builds by replacing the annotation with an embedded proguard file in resources. I can't find much documentation besides this tweet and another library that uses the technique https://twitter.com/jakewharton/status/1004401938467876865?lang=en
Sorry I do have to comment about my disappointment at this statement. It would be much more expedient to work out this sort of issue internally (and probably gotten a quick tip about embedded proguard to boot!) than force your users to follow up. |
This is causing us problems too. It's weird to have to pull in an additional repository considering that out of hundreds of dependencies, nothing else requires this. |
Please fix this issue. I have many many dependencies, and have never had to add another repository, and we will not be adding anything more to our scala project other than the default one. As such, we are not able to upgrade to the latest google java apis. Why was this issue closed? |
This was fixed in 1.30.9 |
Environment details
Steps to reproduce
androidx.annotation#annotation;1.1.0
.Code example
Stack trace
Any additional information below
Previous versions up to 1.30.7 build without any problems.
This seems to mention a similar error, but I am not positive if it is related: #1467 (comment)
The text was updated successfully, but these errors were encountered: