title: Room errors - how to fix them?
body: <p>I'm using room for persistence on my android app and once I create my Database class I get the following errors:</p>
  
  <ul>
  <li>error: Entity class must be annotated with <code>@Entity</code></li>
  <li>error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).</li>
  <li>error: An entity must have at least 1 field annotated with <code>@PrimaryKey</code></li>
  </ul>
  
  <p>I narrowed it down to my Database class my eliminating everything else other than my Entity and <code>DAO</code> classes. I've tried everything I found online but nothing worked.</p>
  
  <p>Here's the Entity class:</p>
  
  <pre><code>import android.arch.persistence.room.ColumnInfo;
  import android.arch.persistence.room.Entity;
  import android.arch.persistence.room.ForeignKey;
  import android.arch.persistence.room.PrimaryKey;
  import android.content.pm.PackageManager;
  
  import static android.arch.persistence.room.ForeignKey.CASCADE;
  
  @Entity
  public class Character {
  
  @PrimaryKey(autoGenerate = true)
  public int characterId;
  
  @ColumnInfo(name = "name")
  public String name;
  
  @ColumnInfo(name = "race")
  public String race;
  
  @ColumnInfo(name = "occupation")
  public String occupation;
  
  @ColumnInfo(name = "shadow")
  public String shadow;
  
  @ColumnInfo(name = "accurate")
  public int accurate;
  
  @ColumnInfo(name = "cunning")
  public int cunning;
  
  @ColumnInfo(name = "discreet")
  public int discreet;
  
  @ColumnInfo(name = "persuasive")
  public int persuasive;
  
  @ColumnInfo(name = "quick")
  public int quick;
  
  @ColumnInfo(name = "resolute")
  public int resolute;
  
  @ColumnInfo(name = "strong")
  public int strong;
  
  @ColumnInfo(name = "vigilant")
  public int vigilant;
  
  @ColumnInfo(name = "toughness")
  public int toughness;
  
  @ColumnInfo(name = "painThreshold")
  public int painThreshold;
  
  @ColumnInfo(name = "corruptionThreshold")
  public int corruptionThreshold;
  
  @ColumnInfo(name = "defense")
  public int defense;
  
  public int inventoryId;
  
  public int spellBookId;
  
  public Character() {
  
  }
  
  public Character(int characterId, String name, String race, String occupation, String shadow, int accurate, int cunning, int discreet, int persuasive, int quick, int resolute, int strong, int vigilant, int toughness, int painThreshold, int corruptionThreshold, int defense, int inventoryId, int spellBookId) {
      this.characterId = characterId;
      this.name = name;
      this.race = race;
      this.occupation = occupation;
      this.shadow = shadow;
      this.accurate = accurate;
      this.cunning = cunning;
      this.discreet = discreet;
      this.persuasive = persuasive;
      this.quick = quick;
      this.resolute = resolute;
      this.strong = strong;
      this.vigilant = vigilant;
      this.toughness = toughness;
      this.painThreshold = painThreshold;
      this.corruptionThreshold = corruptionThreshold;
      this.defense = defense;
      this.inventoryId = inventoryId;
      this.spellBookId = spellBookId;
  }
  ...getters and setters
  </code></pre>
  
  <p>And this is the database class:</p>
  
  <pre><code>@Database (entities = {Character.class}, version = 1)
  public abstract class AppDatabase extends RoomDatabase {
  
  public abstract CharDao charDao();
  }
  </code></pre>
  
  <p>My DAO class:</p>
  
  <pre><code>@Dao
  public interface CharDao {
  
  @Insert
  void addChar (Character character);
  
  }
  </code></pre>
  
  <p>Build.gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion 28
  defaultConfig {
      applicationId "symbhero.studio.com.symbhero"
      minSdkVersion 15
      targetSdkVersion 28
      versionCode 1
      versionName "1.0"
      testInstrumentationRunner 
  "android.support.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation 'com.android.support:appcompat-v7:28.0.0'
  implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'com.android.support.test:runner:1.0.2'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  implementation 'android.arch.persistence.room:runtime:1.1.0'
  annotationProcessor 'android.arch.persistence.room:compiler:1.1.0'
  }
  </code></pre>
  
  <p>I really can't find out where I went wrong. I followed this <a href="https://android.jlelse.eu/getting-started-with-room-persistence-library-8932276b4d8c" rel="nofollow noreferrer">link</a> to set everything up.</p>
  
  <p>All help appreciated!</p>