realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

RealmTransformer doesn't execute when running androidTest

Open danika opened this issue 2 years ago • 1 comments

How frequently does the bug occur?

All the time

Description

In order to avoid duplicating fake test data across test and androidTest, I have created a module sharedtestcode which depends on app. I then consume sharedtestcode as a test dependency of the app module via testImplementation and androidTestImplementation.

This is the recommended way to share test data starting from Android Studio Chipmunk. (see: https://issuetracker.google.com/issues/232420188)

This seems to work fine when running unit tests, but when I attempt to run an android test, I get:

RealmTransformer doesn't seem to be applied. Please update the project configuration to use the Realm Gradle plugin.

Stacktrace & log output

No response

Can you reproduce the bug?

Yes, always

Reproduction Steps

Demo project: https://github.com/danika/RealmSharedTest

Version

10.11.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Android (SDK 31)

Build environment

Android Studio version: Chipmunk 2021.2.1 Patch 2 Android Build Tools version: 7.2.2 Gradle version: 7.3.3

danika avatar Aug 27 '22 01:08 danika

Hi @danika. Thanks for the report. This seems like a duplicate of https://github.com/realm/realm-java/pull/3030 that originates from an issue around which classes that are passed to our transformer. The currently used transforer API of AGP has been undergoing development and will be removed from AGP 8.0, so the original reported issue is left as obsolete. We are currently in the process of migrating to the new API in #7714 (specifically also applying the transformer on unittest and test components) and with this we should hopefully also address this

rorbech avatar Aug 29 '22 11:08 rorbech

hello again, I've updated the realm dependency in my demo project to 10.13.1-transformer-api and the problem persists :(

danika avatar Jan 19 '23 21:01 danika

same issue for me.

codyrotwein avatar Jan 23 '23 15:01 codyrotwein

I can confirm that the issue is fixed with the following combo:

AGP 8.0.0 Kotlin 1.8.20 Realm 10.15.0

thanks!

danika avatar Apr 27 '23 17:04 danika