Skip to content

Model cannot be cast to ModelRealmProxyInterface while using realm jars built from source in Android Project #7875

@73sravanthi

Description

@73sravanthi

How frequently does the bug occur?

Always

Description

I am using Realm jars which are built from source code. I have added realm-library aar file, realm-annotations-10.18.0.jar, realm-transformer-10.18.0.jar, realm-gradle-plugin into libs folder of Android project and tried to build. Able to launch the application however getting

UserModel cannot be cast to io.realm.com_example_mobile_test_auth_model_UserModelRealmProxyInterface
whenever any db operation is performed

Stacktrace & log output

2024-03-07 15:45:21.304  5922-5922  ExampleException         com.example        D  null : null
2024-03-07 15:45:21.305  5922-5922  ExampleException          com.example         D
 UserModel cannot be cast to io.realm.com_example_mobile_test_auth_model_UserModelRealmProxyInterface

Can you reproduce the bug?

Always

Reproduction Steps

Build the realm code base from source

Version

10.18.0

What Atlas App Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Mac OS 14.3

Build environment

Android Studio version: Android Studio Hedgehog | 2023.1.1 Patch 2
Android Build Tools version: 33.0.1
Gradle version: 8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions