Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desugaring and AGP version related crash #115

Open
gnair03 opened this issue Jun 20, 2024 · 5 comments · May be fixed by #117
Open

Desugaring and AGP version related crash #115

gnair03 opened this issue Jun 20, 2024 · 5 comments · May be fixed by #117

Comments

@gnair03
Copy link

gnair03 commented Jun 20, 2024

@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:
instabug_crashlog

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.

@gnair03
Copy link
Author

gnair03 commented Jun 20, 2024

@mattmook : Pls help me with this as soon as you can. We cannot rollout to a wider audience because of this issue.

@gnair03
Copy link
Author

gnair03 commented Jun 21, 2024

@mattmook - This is super important to us and our subsequent releases. Pls let me know if there is any quick fix that can be adopted, without going thru the heavy-duty upgrades.

@gnair03
Copy link
Author

gnair03 commented Jun 24, 2024

@mattmook - Pls help me with this issue, We have disabled CT on 5/6/7 for now. But we want to enable it back again, which requires fixing this asap. Pls help

@gnair03
Copy link
Author

gnair03 commented Jun 26, 2024

@mattmook - Pls respond!

@mattmook
Copy link
Member

mattmook commented Jul 1, 2024

from a point of view of removing dependency on desugaring it requires rewriting any code that uses features of Duration that don't exist on earlier versions of Android. It's certainly possible, but a complete pain.

@mattmook mattmook linked a pull request Jul 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants