A library package can only have the package name declared in its manifest. It's a limitation due to how the R class of the library is not packaged in its classes.jar and instead created by the consuming app.
Since the consuming app uses the library's manifest's package to generate the R class there's no way in the library to have a different package name for different variants (since in an app project, all variants use the original manifest package name for the R class and overrides the package name only in the packaged manifest)
If you need to provide different libraries with different packages, you should use different modules.