Reputation: 65
I am trying to use Realm for my app. When I run, I get errors saying "cannot find symbol variable realm", and "cannot find symbol variable row" for every field in my model class
error: cannot find symbol variable realm
error: cannot find symbol variable row
Task.java
public class Task extends RealmObject {
@PrimaryKey
private int taskId;
@Required
private String taskName;
private boolean completed;
private Date date;
//... auto-generated getters and setters
}
I also get the following two errors for the model class:
error: TaskRealmProxy is not abstract and does not override abstract method realmGet$proxyState() in RealmObjectProxy
error: TaskColumnInfo is not abstract and does not override abstract method copyColumnInfoFrom(ColumnInfo) in ColumnInfo
I tried with multiple model classed that extend RealmObject, and the errors seem to be the same with every class.
I also tried to Clean Project multiple times, but it did not solve the error.
In my build.gradle(project), I have the following dependencies:
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath "io.realm:realm-gradle-plugin:3.2.0"
}
and in the build.gradle(app), I have added the following
apply plugin: 'realm-android'
Upvotes: 0
Views: 1494
Reputation: 81569
any other applied plugins? Do you by chance have a library project that also brings in an outdated version of Realm, for example RealmBasedRecyclerViewAdapter
? –
compile 'com.github.thorbenprimke:realm-recycler-view:0.9.5'
that library is out of date, it's recommended to use http://github.com/realm/realm-android-adapters instead and RealmRecyclerViewAdapter
Upvotes: 1