NoSuchMethodError: old Apache library loaded in Gradle build environment
See original GitHub issueEnvironment:
- Jib version: 1.8.0
- Build tool: Gradle 5.4.1
- OS: OSX 10.14.6
Description of the issue:
When trying to run gradle jibDockerBuild
with the jib gradle plugin v1.8.0, I got a very confusing error message with no results on Google:
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: org.apache.http.client.config.RequestConfig$Builder.setNormalizeUri(Z)Lorg/apache/http/client/config/RequestConfig$Builder;
Expected behavior:
When running the same command with the jib plugin v1.7.0, I get this much more helpful error message:
Steps to reproduce:
1. Kill the docker daemon
2. Add the jib gradle plugin v1.8.0 to a gradle build
3. Run gradle jibDockerBuild
jib-gradle-plugin
Configuration:
plugins {
id 'com.google.cloud.tools.jib' version '1.8.0'
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
How do I fix a NoSuchMethodError? - java - Stack Overflow
To solve it I checked, firstly, Module Dependency Diagram ( click in your POM the combination -> Ctrl+Alt+Shift+U or right click in your...
Read more >3 Steps to Fix NoSuchMethodErrors and ...
A NoSuchMethodError occurs when we're calling a method that does not exist at runtime. The method must have existed at compile time, ...
Read more >Upgrading your build from Gradle 5.x to 6.0
Try running gradle help --scan and view the deprecations view of the generated build scan. Deprecations View of a Gradle Build Scan. This...
Read more >Importing a Gradle project fails with an exception in the latest ...
You should check with a ./gradlew clean build that all dependencies are correctly resolved.
Read more >Building applications with Maven - Quarkus
This should only be used in a development environment. You should not run production application in dev mode. To do this you must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you can ask the parent to load in the jib plugin in the parent but not apply it (
apply false
), so the classpaths are correct?and then use the plugin in your subproject (you can omit the version since it’s specified above)
Can you see if that works? If not, there’s the option of just adding the httpclient at the right version to the buildscript classpath in the root project.
That did indeed fix the issue, thanks! May be useful to add this tip to documentation or troubleshooting.