title: Android Room - cannot find symbol @androidx.room.TypeConverters(value = {StringDataConverter.class, ...})
body: <p>how do you use List's in Android Room
  I've a Table Entity which i like to save in my SQLDatabase via Android Room. I've followed everything i could fine Online and without List's it worked. But when i added List items in my Entity it stopped working:</p>
  
  <pre><code>Table.java:5: error: cannot find symbol
  @androidx.room.TypeConverters(value = {StringDataConverter.class, RowDataConverter.class})
  </code></pre>
  
  <p> </p>
  
  <pre><code>@Entity(tableName = "tables")
      data class Table(
          var name : String,
          var description : String,
          var image : String,
          var colNames : List&lt;String&gt; = emptyList(),
          var rows : List&lt;Row&gt; = emptyList()
      ){
          @PrimaryKey(autoGenerate = true)
          var id: Int = 0
  
          override fun toString(): String {
              return "TableEntity(name='$name', description='$description', image='$image', id=$id)"
          }
      }
  </code></pre>
  
  <p> </p>
  
  <pre><code>data class Row(var items: List&lt;Unit&gt;)
  </code></pre>
  
  <p> </p>
  
  <pre><code>data class Unit(var value : Object, var type : String)
  </code></pre>
  
  <p>I also tried it without <code>TypeConverters</code> in <code>Table</code> same error, but i got it at File <code>TablesDatabase</code> </p>
  
  <p> </p>
  
  <pre><code>@Database(entities = [Table::class], version = 1)
  @TypeConverters(StringDataConverter::class, RowDataConverter::class)
  abstract class TablesDatabase : RoomDatabase(){
      abstract fun tableDao(): TableDao
  
      companion object {
          @Volatile private var instance: TablesDatabase? = null
          private val LOCK = Any()
  
          operator fun invoke(context: Context) = instance ?: synchronized(LOCK){
              instance ?: buildDataBase(context).also{
                  instance = it
              }
          }    
  
          private fun buildDataBase(context: Context) =  Room.databaseBuilder(context.applicationContext, TablesDatabase::class.java, "tablesx2.db").build()
      }
  }
  </code></pre>
  
  <p> </p>
  
  <pre><code>public class StringDataConverter {
      @TypeConverter
      public static List&lt;String&gt; fromString(String value) {
          Type listType = new TypeToken&lt;List&lt;String&gt;&gt;() {}.getType();
          return new Gson().fromJson(value, listType);
      }
  
      @TypeConverter
      public static String fromList(List&lt;String&gt; list) {
          Gson gson = new Gson();
          String json = gson.toJson(list);
          return json;
      }
  }
  
  public class RowDataConverter {
      @TypeConverter
      public static List&lt;Row&gt; fromString(String value) {
          Type listType = new TypeToken&lt;List&lt;Row&gt;&gt;() {}.getType();
          return new Gson().fromJson(value, listType);
      }
  
      @TypeConverter
      public static String fromList(List&lt;Row&gt; list) {
          Gson gson = new Gson();
          String json = gson.toJson(list);
          return json;
      }
  }
  </code></pre>
  
  <p>Ty Stackoverflow</p>
  
  <p><strong>Edit</strong>: I tried it with and without Annotating the <code>Table</code> Class as <code>@TypeConverters(StringDataConverter::class, RowDataConverter::class)</code></p>
  
  <p><strong>Edit 2</strong>: I also tried to rewrite the Entity and use Java instead of Kotlin (just for the Entitiy File) didnt change the Exception (<strong>Appendix 1</strong>)</p>
  
  <p><strong>Edit 3</strong>:</p>
  
  <p>i Added the Following lines to my <strong>build.gradle</strong> (whole Gradle-File <strong>Appendix 2</strong>)</p>
  
  <pre><code>allprojects {
          gradle.projectsEvaluated {
              tasks.withType(JavaCompile) {
                  options.compilerArgs &lt;&lt; "-Xmaxerrs" &lt;&lt; "5000"
              }
          }
      }
  
      android {
          defaultConfig {
              javaCompileOptions {
                  annotationProcessorOptions {
                      arguments = [
                              "room.schemaLocation":"$projectDir/schemas".toString(),
                              "room.incremental":"true",
                              "room.expandProjection":"true"]
                  }
              }
          }
      }
  </code></pre>
  
  <p>And now i see the errors i already saw:</p>
  
  <pre><code>TablesDatabase.java:5: error: cannot find symbol
  @androidx.room.TypeConverters(value = {StringDataConverter.class, RowDataConverter.class})
    symbol: class StringDataConverter
  </code></pre>
  
  <p>and </p>
  
  <pre><code>TablesDatabase.java:5: error: cannot find symbol
  @androidx.room.TypeConverters(value = {StringDataConverter.class, RowDataConverter.class})
    symbol: class RowDataConverter
  </code></pre>
  
  <p>and in addition this new one:</p>
  
  <pre><code>TablesDatabase.java:8: error: [RoomProcessor:MiscError] androidx.room.RoomProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
  public abstract class TablesDatabase extends androidx.room.RoomDatabase {
  </code></pre>
  
  <p><strong>Appendix 1</strong></p>
  
  <pre><code>@Entity(tableName = "tables")
      public class Table {
          @PrimaryKey(autoGenerate = true)
          Integer id = 0;
          String name = "";
          String description = "";
          String image = "";
          List&lt;String&gt; colNames = new ArrayList&lt;&gt;();
          List&lt;Row&gt; rows = new ArrayList&lt;&gt;();
  
          public Table(String name, String description, String image, List&lt;String&gt; colNames, List&lt;Row&gt; rows) {
              this.name = name;
              this.description = description;
              this.image = image;
              this.colNames = colNames;
              this.rows = rows;
          }
  
          public Table(String name, String description, String image, List&lt;String&gt; colNames) {
              this.name = name;
              this.description = description;
              this.image = image;
              this.colNames = colNames;
          }
  
          public Table(String name, String description, String image) {
              this.name = name;
              this.description = description;
              this.image = image;
          }
  
          public Table() {}
  
          @Override
          public String toString() {
              return "Table{" +
                      "id=" + id +
                      ", name='" + name + '\'' +
                      ", description='" + description + '\'' +
                      ", image='" + image + '\'' +
                      ", colNames=" + colNames +
                      ", rows=" + rows +
                      '}';
          }
  
          public Integer getId() {
              return id;
          }
  
          public void setId(Integer id) {
              this.id = id;
          }
  
          public String getName() {
              return name;
          }
  
          public void setName(String name) {
              this.name = name;
          }
  
          public String getDescription() {
              return description;
          }
  
          public void setDescription(String description) {
              this.description = description;
          }
  
          public String getImage() {
              return image;
          }
  
          public void setImage(String image) {
              this.image = image;
          }
  
          public List&lt;String&gt; getColNames() {
              return colNames;
          }
  
          public void setColNames(List&lt;String&gt; colNames) {
              this.colNames = colNames;
          }
  
          public List&lt;Row&gt; getRows() {
              return rows;
          }
  
          public void setRows(List&lt;Row&gt; rows) {
              this.rows = rows;
          }
      }
  </code></pre>
  
  <p><strong>Appendix 2</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
      apply plugin: 'kotlin-android'
      apply plugin: 'kotlin-android-extensions'
      apply plugin: 'kotlin-kapt'
  
      allprojects {
          gradle.projectsEvaluated {
              tasks.withType(JavaCompile) {
                  options.compilerArgs &lt;&lt; "-Xmaxerrs" &lt;&lt; "5000"
              }
          }
      }
  
      android {
          compileSdkVersion 29
          buildToolsVersion "29.0.2"
          defaultConfig {
              applicationId "de.hsos.ma.adhocdb"
              minSdkVersion 22
              targetSdkVersion 29
              versionCode 1
              versionName "1.0"
              testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
              vectorDrawables.useSupportLibrary = true // This line
  
              javaCompileOptions {
                  annotationProcessorOptions {
                      arguments = [
                              "room.schemaLocation":"$projectDir/schemas".toString(),
                              "room.incremental":"true",
                              "room.expandProjection":"true"]
                  }
              }
          }
          buildTypes {
              release {
                  minifyEnabled false
                  proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
              }
          }
      }
  
      dependencies {
          implementation fileTree(dir: 'libs', include: ['*.jar'])
          implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
          implementation 'androidx.appcompat:appcompat:1.1.0'
          implementation 'androidx.core:core-ktx:1.1.0'
          implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
          implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
          implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
          testImplementation 'junit:junit:4.12'
          androidTestImplementation 'androidx.test.ext:junit:1.1.1'
          androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  
  
          def cardViewVersion = "1.0.0"
          def recyclerViewVersion = "1.0.0"
          def glideVersion = "4.11.0"
          def roomVersion = "2.2.3"
          def materialIoVersion = "1.2.0-alpha04"
          def kotlinCoroutinesVersion = "1.3.3"
          def materialDialogVersion = "3.1.1"
          def gsonVersion = "2.8.6"
  
          implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"
  
  
          // room
          kapt "androidx.room:room-compiler:$roomVersion"
          implementation "androidx.room:room-runtime:$roomVersion"
          implementation "androidx.room:room-ktx:$roomVersion"
  
          //material io
          implementation "com.google.android.material:material:$materialIoVersion"
          // Card View
          implementation "androidx.cardview:cardview:$cardViewVersion"
  
          // Recyclerview
          implementation "androidx.recyclerview:recyclerview:$recyclerViewVersion"
  
          //glide
          implementation "com.github.bumptech.glide:glide:$glideVersion"
          annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"
  
          implementation "com.afollestad.material-dialogs:core:$materialDialogVersion"
          implementation "com.google.code.gson:gson:$gsonVersion"
      }
  </code></pre>