I was testing the previous approach by manually unzipping the jar, and modifying the MANIFEST.MF file and then re-zipping the jar. I'm not 100% sure what is going on, but doing that seemed to cause issues with the build so some variants would compile successfully. However, recreating the SNAPSHOT artifact using the publishToMavenLocal would always reproduce the error.
It looks like the problem might be the presence of Manifest-Version, but there doesn't appear to be a way to remove this using the Gradle API.
So I decided to instead refactor our annotation processor to APIs available in Java 11. This unfortunately broke Google's Compile Testing framework which still has not been updated, but that could luckily be worked around using the same approach that people have to use with Realm Java 10.15.0 right now.
The fix introduced in https://github.com/realm/realm-java/pull/7807 turned out to not be enough.
I was testing the previous approach by manually unzipping the jar, and modifying the MANIFEST.MF file and then re-zipping the jar. I'm not 100% sure what is going on, but doing that seemed to cause issues with the build so some variants would compile successfully. However, recreating the SNAPSHOT artifact using the
publishToMavenLocal
would always reproduce the error.It looks like the problem might be the presence of
Manifest-Version
, but there doesn't appear to be a way to remove this using the Gradle API.So I decided to instead refactor our annotation processor to APIs available in Java 11. This unfortunately broke Google's Compile Testing framework which still has not been updated, but that could luckily be worked around using the same approach that people have to use with Realm Java 10.15.0 right now.