-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model cannot be cast to ModelRealmProxyInterface while using realm jars built from source in Android Project #7875
Comments
➤ PM Bot commented: Jira ticket: RJAVA-1251 |
Any help on this. Stuck with the above error and unable to proceed |
Looks like you are not transforming the realm model classes. If you don't apply our plugin you will have to register the transformer yourself. |
Adding the realm-transformer jar file to libs doesn't help here? |
Any help on this |
I have tried using import io.realm.transformer.RealmTransformerKt to register the RealmTransformer in the build.gradle file, however getting below error while trying to build it Caused by: org.gradle.api.UnknownDomainObjectException: Extension of type 'AndroidComponentsExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension, KtlintExtension] Let me know if I missed anything here |
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
The text was updated successfully, but these errors were encountered: