-
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
A RealmObject with no @PrimaryKey cannot be updated #1845
Comments
@zaki50 If they don't update their version to Realm 0.84.2 or avobe yet, isn't it related to that issue? |
This issue should not related with #1775. Since that one only happens when you open the Realm Instance. This issues is more like trying to update a How does |
Hi, all, I'm Kevin from VCNC, who reported that issue to @dalinaum. RAnniversaryView is look like this.
@zaki50 and I guess realm file is not created on older version of realm. I'm putting little more information from crash analytics system. Hope it helps. |
|
@swkimme Sorry for the late reply. I was wondering if you can share a code snippet so we can see how you call |
@kneth
|
@swkimme I haven't been reproduce the issue yet :-( |
@swkimme Did you have a chance to add some logging of |
Closing due to no response. |
Encounter the same issue on devices 4.1.1 and 4.2.2 where it throws no PrimaryKey exception when there is. Using Realm 8.0.0. However, it works on higher version of Android. |
@david201601 Can this be reproduced in your side? Or you just got the crash report from fabric? |
@beeender I am sorry that I could not reproduce the error after my teams update the realm to the latest version. |
I am getting same issue .can someone pls repond me java.lang.IllegalArgumentException: A RealmObject with no @PrimaryKey cannot be updated: |
@engr-erum if you do not have a |
@Zhuinden so it will delete old data from table and create everytime or it will append rows everytime ? |
@engr-erum actually I think it will just append rows everytime. |
@Zhuinden can u pls help me how to avoid appending rows everytime.As i already added primary key in model class but its not working.Here is gist https://gist.github.com/engr-erum/a91cad1302de33fae19813a5e2814012 |
@engr-erum if you need to customize the persistence by that you want to ignore fields in the JSON, then you probably should just use GSON to parcel to real classes and then map out what you need to Realm. |
I got the same issue with kotlin and realm latest version `01-16 20:44:34.557 3349-3349/com.appname E/AndroidRuntime: FATAL EXCEPTION: main @ RealmClass
} build.gradle: dependencies{
} app level build.gradle: ` |
@yuvaraj119 apply |
i tried adding after kotlin-kapt still same issue apply plugin: 'com.android.application' when i add like this as below it throws error :
where my addvehicleImageblob class :
} |
But if you added the class and didn't specify a migration + schema version bump, then that can cause this as well. |
when i add like this as below it throws error :
where my addvehicleImageblob class : @SerializedName("VehicleImageId") } i initialize the realm and migration is not needed: |
facing this error : apply plugin: 'com.android.application' dependencies {
} Information:Gradle tasks [:app:assembleDevDebug] |
the error message tells you exactly:
This means that in @ RealmClass
class UploadData : RealmModel{
@PrimaryKey
var id_: String = UUID.randomUUID().toString()
var awsStatus: Int = -1
var serverStatus: Int = -1
var addVehicleImagesBlob: AddVehicleImagesBlob = AddVehicleImagesBlob() // <-- !!!
} That cannot be @ RealmClass
class UploadData : RealmModel{
@PrimaryKey
var id_: String = UUID.randomUUID().toString()
var awsStatus: Int = -1
var serverStatus: Int = -1
var addVehicleImagesBlob: AddVehicleImagesBlob? = AddVehicleImagesBlob() // <-- !!!
} |
if i use "apply plugin: 'kotlin-kapt'" i am getting this error after removing "apply plugin: 'kotlin-kapt'" great below line fixed the older issue : but now i am getting this error now. It says to use java.lang.String instead of kotlin String Error:19:10:23.808 [ERROR] [system.err] Note: Processing class AddVehicleImagesBlob @ RealmClass
} |
Fix this. It looks like you have a RealmList of unsupported types. Probably a model class that doesn't extend RealmObject or RealmModel |
|
No DamageType class too extends RealmModel @ RealmClass
} |
You mustn't remove |
if i add apply plugin: 'kotlin-kapt' it throws this error |
Well of course, if you add that, you'll see that you have a bug in your code. You should also include the actual error message, not just the first line |
@Zhuinden @cmelchior I have fixed the issue by making my all model class as open which extends RealmModel in kotlin. Great thanks for your instant support. |
... It shouldn't have compiled if the RealmObjects were not all |
//build gradle (app) realm { @RealmClass |
Hi, Please create a new issue instead of commenting on an old closed issue. That way it will be easier to help you |
use import instead of import |
A developer of VCNC encountered the following error message. He uses Realm version 0.84.1 and thinks that RAnniversaryView already has a primary key field.
The text was updated successfully, but these errors were encountered: