AgNO3 / jcifs-ng

A cleaned-up and improved version of the jCIFS library
GNU Lesser General Public License v2.1
318 stars 103 forks source link

Dependency Conflicts With New Version 2.1.5 #250

Open mattiabellohorsa opened 4 years ago

mattiabellohorsa commented 4 years ago

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

Task :app:preBuild UP-TO-DATE Task :app:preSonocoDebugBuild UP-TO-DATE Task :app:compileSonocoDebugAidl NO-SOURCE Task :app:writeSonocoDebugApplicationId UP-TO-DATE Task :app:compileSonocoDebugRenderscript NO-SOURCE Task :app:generateSafeArgsSonocoDebug UP-TO-DATE Task :app:generateSonocoDebugBuildConfig UP-TO-DATE Task :app:prepareLintJar UP-TO-DATE Task :app:prepareLintJarForPublish UP-TO-DATE Task :app:generateSonocoDebugSources UP-TO-DATE Task :app:dataBindingExportBuildInfoSonocoDebug UP-TO-DATE Task :app:dataBindingMergeDependencyArtifactsSonocoDebug UP-TO-DATE Task :app:generateSonocoDebugResValues UP-TO-DATE Task :app:dataBindingMergeGenClassesSonocoDebug UP-TO-DATE Task :app:generateSonocoDebugResources UP-TO-DATE Task :app:mergeSonocoDebugResources UP-TO-DATE Task :app:dataBindingGenBaseClassesSonocoDebug UP-TO-DATE Task :app:dataBindingExportFeaturePackageIdsSonocoDebug UP-TO-DATE Task :app:createSonocoDebugCompatibleScreenManifests UP-TO-DATE Task :app:extractDeepLinksSonocoDebug UP-TO-DATE Task :app:processSonocoDebugManifest Task :app:processSonocoDebugResources Task :app:kaptGenerateStubsSonocoDebugKotlin FAILED

FAILURE: Build failed with an exception.

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 ?

mbechler commented 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).

axelrindle commented 3 years ago

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'
}
mbechler commented 3 years ago

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.

col-panic commented 3 years ago

Same happens for bouncycastle 1.68

michaldo commented 3 years ago

Same happens for bouncycastle 1.69

rastislavpapp commented 2 years ago

@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 :-)

mbechler commented 2 years ago

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.

Liberations commented 2 weeks ago

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'