1

I have a big project already in use, there are many(hundreds of) classes. I want to add a feature like I want to write into SQL database of the phone. And I want to use Android Room library. I am doing everything fine according to the documentation and other reliable sources. However, when I am writing Database class which contains @Database annotation it's giving me error "cannot find symbol class" which is not related to the code I am writing, which was written months ago. If I remove @Database annotation it's compiling and running fine. Could you please help to solve it, because I didn't find case like this one?

I now clarified the real conflict. The thing is that earlier in this project "requery sqlite library" was used, and now there is a conflict between this library and room library.

@Database(entities = [LocationEntity::class], version = 1) line is making error of entity "ChargeItem" which is used in Requery Sqlite library

This ChargeItem is a class written for requery library.

133794m3r
  • 5,028
  • 3
  • 24
  • 37
khamidjon
  • 131
  • 2
  • 6

1 Answers1

0
  implementation 'androidx.room:room-runtime:2.2.5'
  

makes sure you have this two dependencies.Gradle sync. Also, make sure that you have migrated to androidx support library.

This will be your import statemet for annotation:

  import androidx.room.Database;
Rishabh Ritweek
  • 550
  • 3
  • 10
  • Thank you, however, I already have these lines correctly in my implementation. @Database is making problem with very different class file. Don't you have other suggestions? – khamidjon Oct 08 '20 at 09:40
  • can you explain more and give me what error are you getting?? – Rishabh Ritweek Oct 08 '20 at 17:10
  • I have written more details in the question. Could you please see and suggest something? – khamidjon Oct 09 '20 at 06:03
  • You are not explaining clearly where your Error occurred. Don't combine your question and code, for eg, post the Stacktrace, the code snippets that run into an error. – ObinasBaba Oct 09 '20 at 06:26
  • the error I see is :app:kaptDebugKotlin, when I select this error it shows cannot find symbol class "SomeItemClass previously used" – khamidjon Oct 09 '20 at 07:36