flexmark-java icon indicating copy to clipboard operation
flexmark-java copied to clipboard

DuplicatePlatformClasses fatal lint error for commons-logging

Open TinaT2 opened this issue 4 years ago • 1 comments

Build vaiant:release , error message after try to run the app:

 <issue
        id="DuplicatePlatformClasses"
        severity="Fatal"
        message="`commons-logging` defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don&apos;t have the same problem (for example, for `httpclient` use `HttpUrlConnection` or `okhttp` instead), or repackaging the library using something like `jarjar`."
        category="Correctness"
        priority="8"
        summary="Duplicate Platform Classes"
        explanation="There are a number of libraries that duplicate not just functionality of the Android platform but using the exact same class names as the ones provided in Android -- for example the apache http classes. This can lead to unexpected crashes.&#xA;&#xA;To solve this, you need to either find a newer version of the library which no longer has this problem, or to repackage the library (and all of its dependencies) using something like the `jarjar` tool, or finally, rewriting the code to use different APIs (for example, for http code, consider using `HttpUrlConnection` or a library like `okhttp`).">
        <location .../>
    </issue>

Library version: 0.62.2

I've solved it temporarily with

implementation ('com.vladsch.flexmark:flexmark-all:0.62.2' ){
        exclude group: 'commons-logging', module: 'commons-logging'
    }

Is this problem going to be solved soon?

TinaT2 avatar Dec 23 '20 10:12 TinaT2

I faced a similar issue when trying to wrap the application for release build. Screenshot from 2021-03-31 12-22-42

LeoSammy avatar Mar 31 '21 11:03 LeoSammy