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.21k stars 260 forks source link

Android Release build causes crash #586

Open mihirrai opened 11 months ago

mihirrai commented 11 months ago

Everything works fine in release builds, until I start adding extensions.

Error thrown: java.lang.IllegalStateException: Dependent class class

The error thrown is coming from com.vladsch.flexmark.util.dependency.DependencyResolve, so pretty sure its contained within this library and something to with the android framework.

The only difference between debug and release builds is the obfuscation and shrinking. The crash is reproduced even after disabling obfuscation, didn't try disabling shrinking as it would completely bypass the logic of using R8 given the large size of the library.

soupslurpr commented 10 months ago

I am getting this issue as well, disabling shrinking makes it stop, although it is not good as it makes the app size much larger.

FilippoVigani commented 10 months ago

I'm facing this as well ever since I started using AGP 8.0 which sets android.enableR8.fullMode to true by default. One could try to disable fullMode, but that's not ideal. Otherwise we need to find some proguard rules that add exceptions to flexmark, but I'm not sure where to start.