0

In my application i want use database and for this i used Room library.
I added this dependencies :

implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'

But when added Database class show me show below error in build tab :

cannot access Publisher

My Database class :

@Database(entities = {TitlesEntity.class},version = 1,exportSchema = false)
public abstract class TitlesDatabase extends RoomDatabase {
    public abstract TitlesDao titlesDao();
}

How can i fix it?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
DJ Al
  • 283
  • 1
  • 4
  • 10
  • You may find the answer to your question [here](https://stackoverflow.com/questions/55155092/solve-error-cannot-access-publisher-in-android-studio) – Mehdi Varse Dec 01 '19 at 13:35

1 Answers1

1

You are using obsolete dependencies; for Android Jetpack use:

annotationProcessor "androidx.room:room-compiler:2.2.2"
testImplementation "androidx.room:room-testing:2.2.2"
implementation "androidx.room:room-runtime:2.2.2"

The "cannot access Publisher" likely comes from Android Architecture and/or it's RxJava bindings. Beside that, the question is too broad to provide an accurate answer - and there are enough tutorials.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216