Hello I'm building the app with hilt dependecy injector, but when I try to build the app i had error from the title. Here's my code:
Flow class:
@Entity(tableName = "flows_table")
data class Flow @Inject constructor(@PrimaryKey(autoGenerate = true) val id:Int, val name:String, val duration:Int, val actions:ArrayList<Action>)
Action class:
data class Action @Inject constructor(
val type: String,
val color: String?,
val brightness: Int?,
val duration: Float
)
My application:
@HiltAndroidApp
class YeebumApplication : Application() {
//get bulbs repository
private val bulbsDatabase by lazy { BulbsDatabase.getInstance(this)}
val bulbsRepository by lazy { BulbsRepository(bulbsDatabase!!.bulbsDao()) }
//get flows repository
private val flowsDatabase by lazy { FlowsDatabase.getInstance(this) }
val flowsRepository by lazy { FlowsRepository(flowsDatabase!!.flowsDao())}
}
My Fragment:
@AndroidEntryPoint
class ActionDetailsFragment : Fragment() {
@Inject
lateinit var flow: Flow
With the activity everything works perfectly, but when I try to inject dependiences in fragment android studio throw that exception.