appmattus / certificatetransparency

Certificate transparency for Android and JVM
Apache License 2.0
142 stars 29 forks source link

Missing classes detected while running R8 with AGP > 8 #96

Closed EvgeniyMish closed 3 months ago

EvgeniyMish commented 1 year ago

Trying to compile the project getting the following error:

Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /.../.../build/outputs/mapping/.../missing_rules.txt.
Missing class java.lang.invoke.StringConcatFactory (referenced from: void CertificateTransparencyLogger.log(java.lang.String, com.appmattus.certificatetransparency.VerificationResult) and 12 other contexts)
mattmook commented 11 months ago

Related to https://github.com/Kotlin/kotlinx.serialization/issues/2145? Looks like I should be able to tweak the compiler options with the following when building the library to prevent this:

freeCompilerArgs = listOf("-Xstring-concat=inline")
mattmook commented 11 months ago

I think part of the reason why I hadn't seen this before is the apps I'm using the library in personally are built with Java 11. I assume yours is built with Java 8 currently?

mattmook commented 3 months ago

As an added note according to https://issuetracker.google.com/issues/250197571#comment29 if the Android project uses desugaring then you also shouldn't see this exception. See https://developer.android.com/studio/write/java8-support#library-desugaring