Crash: property 'x' has been made unindexed after updating version of realm from 3.5.0
See original GitHub issueGoal
I want to update realm from 3.5.0 to any higher version (suppose 3.6.0)
Expected Results
Everything goes smooth
Actual Results
App crashes after I call Realm.getInstance for the first time with the exception:
09-09 23:22:29.827 11012-11012/com.wordace.learn.debug W/System.err: io.realm.exceptions.RealmMigrationNeededException: Migration is required due to the following errors:
09-09 23:22:29.828 11012-11012/com.wordace.learn.debug W/System.err: - Property 'Word.translation' has been made unindexed.
09-09 23:22:29.828 11012-11012/com.wordace.learn.debug W/System.err: - Property 'Word.writing' has been made unindexed.
09-09 23:22:29.828 11012-11012/com.wordace.learn.debug W/System.err: - Property 'Word.skipped' has been made unindexed.
09-09 23:22:29.828 11012-11012/com.wordace.learn.debug W/System.err: - Property 'Word.enabled' has been made unindexed.
09-09 23:22:29.829 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.internal.SharedRealm.nativeGetSharedRealm(Native Method)
09-09 23:22:29.829 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.internal.SharedRealm.<init>(SharedRealm.java:177)
09-09 23:22:29.829 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:224)
09-09 23:22:29.829 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.b.<init>(BaseRealm.java:124)
09-09 23:22:29.829 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.b.<init>(BaseRealm.java:93)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.v.<init>(Realm.java:150)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.v.a(Realm.java:417)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.RealmCache.b(RealmCache.java:348)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.RealmCache.a(RealmCache.java:281)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at io.realm.v.b(Realm.java:346)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at com.wordace.learn.WelcomeActivity$f$3$1.a(WelcomActivity.kt:564)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at com.wordace.learn.WelcomeActivity$f$3$1.call(WelcomActivity.kt:182)
09-09 23:22:29.830 11012-11012/com.wordace.learn.debug W/System.err: at io.reactivex.internal.operators.observable.e.b(ObservableFromCallable.java:42)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at io.reactivex.e.a(Observable.java:10903)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at io.reactivex.internal.operators.observable.ObservableSubscribeOn$a.run(ObservableSubscribeOn.java:96)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at io.reactivex.j$a.run(Scheduler.java:452)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
09-09 23:22:29.831 11012-11012/com.wordace.learn.debug W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
09-09 23:22:29.832 11012-11012/com.wordace.learn.debug W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
09-09 23:22:29.832 11012-11012/com.wordace.learn.debug W/System.err: at java.lang.Thread.run(Thread.java:764)
What I tried
I tried to add @Index annotation to specified columns, but it doesn’t change a thing
Code Sample
Here’s code of my model
open class Word : RealmObject() {
@PrimaryKey @Required
open var id: Long? = null
open var translation: String? = null
open var transcription: String? = null
open var writing: String? = null
@Required
open var skipped: Boolean? = null
@Required
open var enabled: Boolean? = null
@Required
open var level: Int? = null
}
Version of Realm and tooling
Realm version(s): 3.6.0 and above
Realm sync feature enabled: yes
Android Studio version: 3.0.0 - BETA5
Which Android version and device: 8.0.0, nexus 6p
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Realm: Create reactive mobile apps in a fraction of the time
Install Realm as a Gradle plugin. Step 1: Add the class path dependency to the project level build.gradle file. Copy to clipboard buildscript...
Read more >Realm Java Migration: Property has been made required
1 Answer 1 · 3. note that you might need to bump the schema version and check if the field is nullable, and...
Read more >realm-swift - Gitea Yiem
Fix a crash when using value(forKey:) on a LinkingObjects property ... Realm Cloud has already been upgraded to this version, and users using...
Read more >realm-common - Yarn
Improve performance when a new Realm file connects to the server for the first time, especially when significant amounts of data has been...
Read more >Source - GitHub
The following APIs have been renamed on the `Realm`: | Before | After ... Fixed flexible sync crash when updating subscriptions after token...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@beeender Thank you for help. As it turned out to be - bug was in 3.5.0 version, not in new ones.
@krottv Just tried with 3.5.0 and checked the code, it was actually a bug in 3.5.0 that for some reasons, the indexed annotation was not checked during validating the schema 😦