Description
@mattmook IMPORTANT
I am on v2.4.0 of the appmattus/certificateTransparency library.
We use Android Gradle plugin v7.4.2 and
With the above configuration - the app crashes on Android versions 5/6/7 with ClassNotFoundException as follows:
Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration; at o.onStartNestedScroll.<clinit>(SourceFile:137) at o.onNestedScroll.valueOf(SourceFile:127) at o.onNestedScroll.InstrumentAction(SourceFile:119) at o.isMatchConstraintEqualityCandidate$Instrument.valueOf(SourceFile:16)
The java.time package used in the LogListCacheManagementDataSource class is the root cause
I found out that not having the desugaring dependency has caused this issue and hence added the desugaring dependency as follows:
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
Post this, the app started crashing with another exception as shown below:
On further debugging, I found the below 2 links -
Google Issue Tracker
AGP fix changelog: https://developer.android.com/studio/releases/fixed-bugs/studio/2022.3.1#android-studio-giraffe-canary-11-2022.3.1.11
The crash is related to Desugaring version incompatibility with the AGP version we use. The solution seems to be hinting towards upgrading AGP to 8.1.0+. But this involves a major upgrade of Android 17 as well, increasing the scope of the fix.
Is there any easier way to solve for this crash without having to do all these upgrades? Pls let us know.