probably R8 can see (correctly) that none of the classes are being used, so it removes all of them?
You might consider updating the proguard rules file to specify an entry point to "keep" in your library. Then everything referenced by that, transitively, will not be removed