realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Realm Transformer Output Missing During Android Instrumented Test #7880

Closed ClockerZadq closed 1 month ago

ClockerZadq commented 2 months ago

How frequently does the bug occur?

Always

Description

This is related to https://github.com/realm/realm-java/issues/2936 and https://github.com/realm/realm-java/pull/3030

After upgrading to Gradle 7, our build is now issuing a warning about a deprecated feature (the AGP Transformer API). It seems that newer versions have been released to address this however our app is not currently able to support realm 10-x versions.

When running Android instrumented tests a ClassCastException is being thrown at runtime. Several attempts were made to resolve this, like adding kotlin-kapt before realm-android Gradle plugin. The exception only occurs during instrumentation tests.

The output of the realm transformer is being generated to the app/build/intermediates/transforms. Yet the final APK being ran does not contain the generated source.

Stacktrace & log output

java.lang.ClassCastException: my.package.MyRealmObject cannot be cast to io.realm.my_package_MyRealmObjectProxyInterface

Can you reproduce the bug?

Always

Reproduction Steps

in app/build.gradle androidTestImplementation project(":app")

Version

6.1.0 up to 10.11.1

What Atlas App Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

Android 10-13

Build environment

sync-by-unito[bot] commented 2 months ago

➤ PM Bot commented:

Jira ticket: RJAVA-1254

kneth commented 2 months ago

We have a fix in Realm Java v10.16.0 of AGP. Please try to upgrade.

github-actions[bot] commented 1 month ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.