title: Cannot set up Realm in project using Kotlin
body: <p>I'm trying to build a test project in Kotlin with Realm. 
  Here's my model:</p>
  
  <pre><code>open class Book : RealmObject() {
  
      // Standard getters &amp; setters generated by your IDE…
      @PrimaryKey
      open var id: Long = 0
  
      open var title = ""
  
      open var description = ""
  
      open var author = ""
  
      open var imageUrl = ""
  }
  </code></pre>
  
  <p>and here's exception I get:</p>
  
  <pre><code>FATAL EXCEPTION: main
                                                                          Process: app.androidhive.info.realm, PID: 18782
                                                                          java.lang.RuntimeException: Unable to start activity ComponentInfo{app.androidhive.info.realm/app.androidhive.info.realm.activity.MainActivity}: java.lang.IllegalArgumentException: Book is not part of the schema for this Realm
                                                                              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                              at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                              at android.os.Looper.loop(Looper.java:148)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                           Caused by: java.lang.IllegalArgumentException: Book is not part of the schema for this Realm
  </code></pre>
  
  <p>I searched around for the solution so and added  <code>classpath "io.realm:realm-gradle-plugin:2.2.2"</code> in build.gradle and 
  <code>apply plugin: 'realm-android'</code> and </p>
  
  <pre><code>dependencies {
      ...
      // Realm
      compile 'io.realm:realm-android:0.87.4'
      kapt "io.realm:realm-annotations:0.87.4"
      kapt "io.realm:realm-annotations-processor:0.87.4"
  }
  </code></pre>
  
  <p>into build script in module app. It gives me another problem: </p>
  
  <pre><code>Error:(15, 48) Cannot access '&lt;init&gt;': it is public/*package*/ in 
  
  'Builder'
  /Volumes/Toshiba/Users/macuser/Development/Android/Exersises/MyApplication/app/src/main/java/realmtest/realm/RealmController.kt
  Error:(27, 15) Unresolved reference: refresh
  Error:(34, 15) Unresolved reference: clear
  Error:(53, 23) Unresolved reference: allObjects
  
  [KOTLIN] deleting /Volumes/Toshiba/Users/macuser/Development/Android/Exersises/MyApplication/app/build/tmp/kotlin-classes/debug on error
  </code></pre>
  
  <p>I can only build my project successfully if Book is written in java. 
  Any suggestion how to make Realm and Kotlin work together?</p>