With older JDK versions I included rt.jar
in R8 configuration with
-libraryjars <java.home>/lib/rt.jar
In order to meet requirements of various java libraries not Android-specific (NOTE this doesn't mean that whole rt.jar
will be included in App, it's just a practical way to avoid R8 optimization to strip away important Java SE code without configuring all keep whitelist one by one)
With JDK above 8 rt.jar
is no longer available and it has been replaced by jmods
, searching seems the proguart syntax to include equivalent jmods alternative to rt.jar
seems to be
-libraryjars <java.home>/jmods/java.base.jmod(!**.jar,!module-info.class)
So I have tried it, but unfortunately with R8 I get this error:
Unexpected input type. Only archive types are supported, e.g., .jar, .zip, etc.
What is the correct way to include it?