title: How to fix "Object is not part of the schema for this Realm"
body: <p>I'm trying to set up an application that uses the <code>Realm</code> database but I can't seem to make it work. I've also disabled <code>Instant Run</code> but that didn't solve the problem either.</p>
  
  <p>Here are my code files:</p>
  
  <p><strong>App level build.gradle</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android-extensions' // &lt;-- these two were the problem
  apply plugin: 'kotlin-android'            // &lt;--
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'realm-android'
  </code></pre>
  
  <p><strong>Project level build.gradle</strong></p>
  
  <pre><code>dependencies{
      classpath 'com.android.tools.build:gradle:3.3.0'
      classpath 'com.google.gms:google-services:4.0.1'
      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      classpath 'io.realm:realm-gradle-plugin:5.8.0'
  }
  </code></pre>
  
  <p><strong>One of my model classes</strong></p>
  
  <pre><code>public class ClothingItem extends RealmObject{
      private String mItemName;
      private RealmList&lt;String&gt; mItemTags;
      ....
  </code></pre>
  
  <p><strong>Application class where I initialize Realm</strong></p>
  
  <pre><code>public void onCreate(){
      super.oncreate();
      Realm.init(this);
      RealmConfiguration config = new RealmConfiguration.Builder()
              .deleteRealmIfMigrationNeeded()
              .name("MyOnlineWardrobe.realm")
              .build();
      Realm.setDefaultConfiguration(config);
  }
  </code></pre>