-
Notifications
You must be signed in to change notification settings - Fork 18
The class 'ClasName' doesn't exist in this Realm. #1
Comments
Did you add realm plugin to your gradle config? |
Hi @mogol, I had forgotten to perform step 2 of the Realm documentation link for Java. Step 2: Apply the realm-android plugin to the top of the application level build.gradle file.
Now that I added that line, and I run Duplicate class io.realm.BaseModuleMediator found in modules classes.jar (io.realm:realm-android-library-object-server:5.13.0) and classes.jar (io.realm:realm-android-library:5.13.0) Go to the documentation to learn how to Fix dependency resolution errors. |
In file ./android/app/build.graddle added:
...and compiled ok :) I think it should be in the documentation. |
|
@mogol I have upgraded to version 6.0.0 and made everything in the post but I get the error that my class is not found and I can't query the database, example is not working as well |
Hi @dimityrivanov |
@mogol tried with 5.13.0 and I get this error : Unhandled Exception: PlatformException(Class does not exist in the Realm and cannot be queried: Transaction, Class does not exist in the Realm and cannot be my code is as follow :
and here is the scheme:
the example in the repo is not working as well, you add a record to the fetchWidget and after a reload the item is not there! |
@dimityrivanov I would recommend to continue discussion in your issue #5 , as the problem looks different to this thread. |
@mogol this issue name is Error: The class 'ClasName' doesn't exist in this Realm. mine is exactly the same. I will close the other one you answered my question there. |
@dimityrivanov could you confirm that realm plugin is configured correctly in your gradle config?
|
@mogol added the plugin using the
without it does not work. Also the I create the object the following way -> widget.realm.createObject('Transaction', transaction.toJson()) but I get the error when I fetch all of them widget.realm.allObjects('Transaction') |
Did you add this line? |
@mogol Yes
The only difference I see is that my project is in Kotlin and in your example I don't see Kotlin support |
🤔 it should work. I would recommend then to create your object in native code and check if it works or not. You can follow the sample in Realm Docs If it doesn't work, please check your realm configuration in Android If it works, please compare your project with the example, as it works, to find the difference. |
@mogol I think I made it working if the project support Kotlin I had to use |
Error: The class
'ClasName'
doesn't exist in this Realm.Exception on line
await realm.createObject('ClassName', myclass.toMap());
onmain.dart
In Flutter, main.dart
In Flutter object path:
app_ns/lib/src/dao/class_name_dao.dart
My config in Android path:
android/app/src/main/java/com/example/app_ns/model/ClassName.java
Code in Java:
The text was updated successfully, but these errors were encountered: