vsch / flexmark-java

CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
BSD 2-Clause "Simplified" License
2.29k stars 271 forks source link

DuplicatePlatformClasses fatal lint error for commons-logging #433

Open TinaT2 opened 3 years ago

TinaT2 commented 3 years ago

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?

LeoSammy commented 3 years ago

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