Open mattiabellohorsa opened 4 years ago
This error is due to the new bouncycastle version which is provided as a multi-release JAR which a lot of software unfortunately has problems with. You can work around this by replacing the dependency with bcprov-jdk15to18. This is going to be the case for upcoming versions (but no concrete plans for a release yet).
I could fix the issue by changing the following in my app build.gradle
:
implementation 'org.bouncycastle:bcprov-jdk15to18:1.66'
implementation (group: 'ch.pontius.nio', name: 'smb-nio', version: '0.8.0') {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
}
Ultimately, you should be able to freely choose between jdk15to18 and jdk15on versions for your projects and override the deps accordingly. Unfortunately this seems to be causing some issues both ways (in your case by pulling both artifacts at the same time, in others with various tools not supporting multi-release JARs), so I guess there is no way around people managing their depencies properly. So far the broken tooling case has come up more often so I think sticking with jdk15to18 makes sense.
Same happens for bouncycastle 1.68
Same happens for bouncycastle 1.69
@mbechler I've encountered this problem with jcifs-ng/2.1.5 running on apache-karaf, after upgrading to a new version (4.3.6) which bumped bouncycastle to 1.69. I've tried upgrading to jcifs-ng/2.1.7, and it solved the issue, somehow :-)
I switched back to the "regular" bouncycastle (= multi-release JAR) dependency in 2.1.7, as I got the feeling this was causing more issues than the other way round.
implementation("org.codelibs:jcifs:2.1.34"){ exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' } implementation 'org.slf4j:slf4j-api:1.7.36' implementation 'org.bouncycastle:bcprov-jdk15to18:1.66'
After i upgrade the version of dependency at 2.1.5, i see that error: Executing tasks: [:app:assembleSonocoDebug] in project C:\Users\mattia.bello\Documents\Projects\InventoryScanner-Android\InventoryScanner
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:kaptGenerateStubsSonocoDebugKotlin'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s 17 actionable tasks: 3 executed, 14 up-to-date
Then, i try to downgrade at 2.1.4 and my project build without problem.
Why this behavior ?