Adding Realm to your project

suggest change

Add the plugin to the buildscript block of the project-level build.gradle. classpath is not a normal module dependency.

buildscript {
    dependencies {
        classpath "io.realm:realm-gradle-plugin:3.1.2"
    }
}

Add the following right at the top of your app level build.gradle file.

apply plugin: 'realm-android'

Sync Gradle. Realm is then available to the module.

Since Realm 2.0.0 you must initialize it before use, in your Application class or in the first activity’s onCreate:

Realm.init(this); // added in Realm 2.0.0
Realm.setDefaultConfiguration(new RealmConfiguration.Builder().build());

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents