realm/realm-java

Android Gradle Plugin 8 Support

cmelchior opened this issue · 4 comments

This is a meta issue tracking current issues with Android Gradle 8, current workarounds, and how we intend to fix them:

Current issues:

  • #7801. In AGP 7.4, Google introduced a new Transformer API, and in 8.0 the old API was completely removed. Realm is currently supporting the new API using a special release named 10.14.0-transformer-api, ie. using 10.14.0 with AGP 8 will not work, you must use the named release.

  • #7799. Due to module constraints introduced in Java 17, the Realm Java Annotation Processor is not compatible with it. It can be worked around by using either using gradle properties or by modifying the build.gradle file. See the issue for more details.

  • #7802. Builds using the new transformer API are reported to be significantly slower in some cases. This is still being investigated.

  • #7798). There seems to be an unfortunate interaction between MoshiX and Realm transformer API's causing MoshiX's proguard files to not be correctly added to the final build. It can be worked around by manually adding them. See #7798 (comment) for more details.

Roadmap for fixes

  • 10.14.0-transformer-api will be merged to main and released as 10.15.0. This will also bump the minimum required AGP to 7.4 and the minimum Java version to 11.
  • The Realm Annotation Processor will be made compatible with Java 17.
  • Build speed will be further investigated.
  • MoshiX interaction needs to be further investigated but has a low priority compared to the issues above.

Realm Java 10.15.0 has been released with fixes problems with Java 17 and makes use of the new transformer APIs from Google, which also means that the minimum supported version of AGP is now 7.4.

10.15.0 was released too quickly and turned out to not work after all. 10.15.1 is now available on Maven Central and contains a rewrite of the problematic APIs and should thus work correctly with Java 17.

is that been resolved?

Yes, this should be working from 10.15.0 onwards. The latest release is 10.16.1.