Recycler View android studio

  android, android-studio

I put a recycler view in the xml give it an id than went to the main activity to call the id but it did not appear I cleaned the project and rebuild closed it opened it again cloud not find it than I tried to use binding and it did find the id but it gave me this error

Cannot access ‘no_name_in_PSI_3d19d79d_1ba9_4cd0_b7f5_b46aa3cd5d40’ which is a supertype of ‘com.example.recyclervew.databinding.ActivityMainBinding’. Check your module classpath for missing or conflicting dependencies

I even tried using the Bata version but same error

package com.example.recyclervew

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.recyclervew.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {
    private lateinit var binding: ActivityMainBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        binding.recyclerView
    }
}[enter image description here][1]


  [1]: https://i.stack.imgur.com/bBBsD.png

Source: Android Questions

LEAVE A COMMENT