java.lang.IncompatibleClassChangeError at DotenvPropertyLoader.java:11 - java

I updated spring-dotenv to 2.5.3 from 1.0.0 like below build.gradle.
dependencies {
implementation 'me.paulschwarz:spring-dotenv:2.5.3'
}
then, I execute ./gradlew build happened IncompatibleClassChangeError.
java.lang.IncompatibleClassChangeError at DotenvPropertyLoader.java:11
Why caused this error?
I have seen other answers like below. But I can't solve this problem.
What causes java.lang.IncompatibleClassChangeError?
Does anyone have any idea?
Thanks.

I solved this problem.
I edited build.gradle like below.
// before
implementation ('me.paulschwarz:spring-dotenv:2.5.3')
// after
api ('me.paulschwarz:spring-dotenv:2.5.3')
but, I don't know why this solved it.

Related

DefaultTaskContainer#NamedDomainObjectProvider.configure(Action) on task set cannot be executed in the current context

I am getting this error when I try to connect my app with firebase.
and here are Gradle scripts
Google broke something in com.google.gms:google-services:4.3.9
Change it to com.google.gms:google-services:4.3.8 and I suspect it will work. I have the same issue, and no amount of fiddling around with gradle scripts has fixed it, only downgrading.
A new version 4.3.10 was released with a fix. Give it a try
https://firebase.google.com/support/release-notes/android#google-services_plugin_v4-3-10
Use classpath 'com.google.gms:google-services:4.3.10' in build.gradle(project: app_name)
It will be fixed.

No variants of io.grpc:protoc-gen-grpc-java:1.33.1 match the consumer attributes

Issue:
I'm using Dexguard to obfuscate codes for release build.
Previously, I could build as normal without errors.
However, when I add this dependency com.github.hyperledger:iroha-java:7.0.0, the release build process failed with an error in the screenshot below:
I guess the library internally depends on io.grpc:protoc-gen-grpc-java, but somehow Dexguard SDK can't find the dependency with the correct artifactType = dexguard-consumer-rules.
What I have tried:
adding io.grpc:protoc-gen-grpc-java:1.33.1
downgrading/upgrading version of iroha-java
Now I am not sure if the problem is caused by Dexguard or the iroha-java library.
So in case you have experiences related to this issue, please guide.
Dexguard can be causing the issue. In our experience it might be beneficial to just set up some rules within it so it would avoid the library. That should work.
In case someone also faced this error:
The solution is to downgrade iroha version to 5.2.1 and exclude io.grpc from it.
implementation('com.github.hyperledger.iroha-java:client:5.2.1') {
exclude group: 'io.grpc', module: 'protoc-gen-grpc-java'
}

Project Lombok AllArgsConstructor not working

It seems like many people are having this problem, but none of the problems i have researched so far are that basic like my problem.
I only got this object:
and a basic call in my main method:
Bamm... already not working. The compilataion fails with this error
I am using IntelliJ and have installed the Lombok plugin.
If it helps... here is my build.gradle:
Any ideas ?
Lombok uses the annotation processor to do its magic so you have to add lombok annotationProcessor dependency in your build.gradle file. Add this line inside your dependencies block:
annotationProcessor 'org.projectlombok:lombok:1.18.6'

JWTParser - NoSuchMethodError - ObjectMapper.readerFor

I'm getting the below error while trying to create JWTVerifier object in order to decode the token. Can you please help me understand what could be the root cause? Thanks in advance.
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader;
at com.auth0.jwt.impl.JWTParser.<init>(JWTParser.java:25)
at com.auth0.jwt.impl.JWTParser.<init>(JWTParser.java:20)
at com.auth0.jwt.JWTDecoder.<init>(JWTDecoder.java:27)
at com.auth0.jwt.JWT.decode(JWT.java:45)
I believe, you are using the wrong jackson-databind library version. The error you see appears, when you have a library containing a class but the class is missing a method. Why? Well, probably the method is not in the version you are using or has been deprecated and removed.
Please check your maven/gradle/whatever you are using and play with the version definition a bit. If this does not help, see the output of mvn dependency:tree or similar in the build tool of your choice.

Error:scala: 'jvm-1.8' is not a valid choice for '-target' in sbt project

I have a scala,sbt project to run and getting the exception below. Tried to find the solution on internet, only gradle related solutions were available.
Error:scala: 'jvm-1.8' is not a valid choice for '-target'
Error:scala: bad option: '-target:jvm-1.8'
I tried changing the compiler config and other intellij idea settings but unsuccessful to get rid of this issue.
What is missing here ?
Attached the screenshot.
This is the setting you are missing in SBT (added in build.sbt):
javacOptions ++= Seq("-target", "1.8")
encountered same issue with gradle. turns out need to update gradle to latest version. you might would like to try same for SBT.

Categories

Resources