Hilt compilation issue without any details

79 Views Asked by At

I am trying to use Hilt on a sample project

but when i compiled my project, i have this sample error message :

Cause: com.example.pokemon.ui.Hilt_MainActivity

enter image description here

This is my activity aclass:

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {

    private var binding: ActivityMainBinding? = null
    private var isFavoriteListVisible = false

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding?.root)

        supportFragmentManager.beginTransaction()
                .replace(R.id.frameLayout, Home())
                .commit()

        binding?.changeFragment
                ?.setOnClickListener {
                    if (isFavoriteListVisible) {
                        isFavoriteListVisible = false
                        binding?.changeFragment?.text = "Favorites"
                        supportFragmentManager.beginTransaction()
                                .replace(R.id.frameLayout, Home())
                                .commit()
                    } else {
                        isFavoriteListVisible = true
                        binding?.changeFragment?.text = "Home"
                        supportFragmentManager.beginTransaction()
                                .replace(R.id.frameLayout, Favorites())
                                .commit()
                    }
                }
    }
}

What can i do to resolve it or have more details about this issue

0

There are 0 best solutions below