Skip to content

ExceptionInInitializerError on release compilation, not in debug #52

@NoeTeria

Description

@NoeTeria

Hi,

I have an error when i'm compiling an Android project (Gradle 8.7) that uses HTMLUnit. I have to use “minifyEnabled false” otherwise I can't compile the project.

I get the following error:
Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in C:\Users\Max\AndroidStudioProjects\HtmlUnitTest\app\build\outputs\mapping\release\missing_rules.txt.

When I add the lines present in the missing_rules.txt file to the proguard-rules.pro file, compilation works, but when the application is launched, it crashes with the following error, only in release version, in debug it works perfectly:
2024-12-20 21:51:43.675 4769-4856 AndroidRuntime com.example.htmlunittest E FATAL EXCEPTION: Thread-4 Process: com.example.htmlunittest, PID: 4769 java.lang.ExceptionInInitializerError at h0.c.run(Unknown Source:0) Caused by: U0.a: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.impl.LogFactoryImpl" on path: DexPathList[[zip file "/data/app/~~1DICEQ7q6eNAuBKvozLXPw==/com.example.htmlunittest-AosG8OuIiji70Y2tiTizbw==/base.apk"],nativeLibraryDirectories=[/data/app/~~1DICEQ7q6eNAuBKvozLXPw==/com.example.htmlunittest-AosG8OuIiji70Y2tiTizbw==/lib/arm64, /system/lib64, /system/system_ext/lib64]] at U0.b.run(Unknown Source:397) at java.security.AccessController.doPrivileged(AccessController.java:43) at U0.e.h(Unknown Source:5) at U0.e.b(Unknown Source:826) at V0.l.<clinit>(Unknown Source:0) at h0.c.run(Unknown Source:0) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.impl.LogFactoryImpl" on path: DexPathList[[zip file "/data/app/~~1DICEQ7q6eNAuBKvozLXPw==/com.example.htmlunittest-AosG8OuIiji70Y2tiTizbw==/base.apk"],nativeLibraryDirectories=[/data/app/~~1DICEQ7q6eNAuBKvozLXPw==/com.example.htmlunittest-AosG8OuIiji70Y2tiTizbw==/lib/arm64, /system/lib64, /system/system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at U0.b.run(Unknown Source:25) at java.security.AccessController.doPrivileged(AccessController.java:43) at U0.e.h(Unknown Source:5) at U0.e.b(Unknown Source:826) at V0.l.<clinit>(Unknown Source:0) at h0.c.run(Unknown Source:0)

Do you have any idea how to solve this problem ?
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions