App crash while calling RecyclerView says PID: 32217 : logs are like this 

> E/AndroidRuntime: FATAL EXCEPTION: main
>     Process: com.example.notes, PID: 32217
>     android.view.InflateException: Binary XML file line #11: Attempt to invoke virtual method 'boolean
> java.lang.String.equals(java.lang.Object)' on a null object reference
>     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on
> a null object reference
>         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
>         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
>         at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
>         at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
>         at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
>         at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
>         at com.example.notes.adapters.NotesRecyclerAdapter.onCreateViewHolder(NotesRecyclerAdapter.java:34)
>         at com.example.notes.adapters.NotesRecyclerAdapter.onCreateViewHolder(NotesRecyclerAdapter.java:18)
>         at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
>         at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
>         at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
>         at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
>         at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
>         at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
>         at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
>         at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
>         at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
>         at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
>         at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1183)
>         at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:870)
>         at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:889)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
>         at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at androidx.appcompat.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:446)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
>         at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
>         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
>         at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
>         at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
>         at com.android.internal.policy.DecorView.onLayout(DecorView.java:955)
>         at android.view.View.layout(View.java:20967)
>         at android.view.ViewGroup.layout(ViewGroup.java:6440)
>         at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3092)
>         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2779)
>         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1863)
> 2019-09-24 16:50:58.474 32217-32217/? E/AndroidRuntime:     at
> android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8072)
>         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
>         at android.view.Choreographer.doCallbacks(Choreographer.java:723)
>         at android.view.Choreographer.doFrame(Choreographer.java:658)
>         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
>         at android.os.Handler.handleCallback(Handler.java:790)
>         at android.os.Handler.dispatchMessage(Handler.java:99)
>         at android.os.Looper.loop(Looper.java:164)
>         at android.app.ActivityThread.main(ActivityThread.java:7000)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
>         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

NotesRecyclerAdapter.java 



public class NotesRecyclerAdapter extends RecyclerView.Adapter<NotesRecyclerAdapter.NotesViewHolder> {

    private static final String TAG = "NotesRecyclerAdapter";

    private ArrayList<Note> mNotes ;

    public NotesRecyclerAdapter(ArrayList<Note> mNotes) {

        this.mNotes = mNotes;
    }


    @NonNull
    @Override
    public NotesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        Log.d(TAG, "onCreateViewHolder: started");
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.note_list_item, parent, false);
        Log.d(TAG, "onCreateViewHolder: created");
        return new NotesViewHolder(view);


    }

    @Override
    public void onBindViewHolder(@NonNull NotesViewHolder holder, int position) {
        Log.d(TAG, "onBindViewHolder: started ");
        holder.notes_tv.setText(mNotes.get(position).getTitle());
        holder.time_tv.setText(mNotes.get(position).getTimeStamp());


    }

    @Override
    public int getItemCount() {
        Log.d(TAG, "getItemCount: start");
        return mNotes.size();

    }

    public class NotesViewHolder extends RecyclerView.ViewHolder{

        TextView notes_tv, time_tv;
        public NotesViewHolder(@NonNull View itemView) {
            super(itemView);
            notes_tv = itemView.findViewById(R.id.notes_tv);
            time_tv = itemView.findViewById(R.id.time_tv);
            Log.d(TAG, "NotesViewHolder: ");

        }
    }
}


this is the MainActivity.java

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";
    //ui components
    RecyclerView mRecyclerView;

    //var
     private NotesRecyclerAdapter mAdapter;
   private  ArrayList<Note> noteArrayList = new ArrayList<>();
    verticalSpacingItemDecorator verticalSpace;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.d(TAG, "onCreate: Activity created ");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mRecyclerView = findViewById(R.id.recycler_view);
        initRecyclerView();
        insertFakeData();

        Log.d(TAG, "onCreate: done");

    }



    public void insertFakeData()
    {

        for(int i = 0; i<=5; i++)
        {
            Note note = new Note();
           note.setTitle("title 1" );
            note.setContent("content #: 1");
           note.setTimeStamp("jan ");
           noteArrayList.add(note);
        }
        //to tell adapter to chk data set
        mAdapter.notifyDataSetChanged();
        Log.d(TAG, "insertFakeData: inserted");
    }

    public  void initRecyclerView()

    {
        Log.d(TAG, "initRecyclerView:  started");
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mRecyclerView.setLayoutManager(layoutManager);
        verticalSpace = new verticalSpacingItemDecorator(10);
       mRecyclerView.addItemDecoration(verticalSpace);
        mAdapter = new NotesRecyclerAdapter(noteArrayList);  //setting adapter with empty dataset
        mRecyclerView.setAdapter(mAdapter);

        Log.d(TAG, "initRecyclerView:  done");

    }
}



Not able to find the solution , by debugging, i found that onBindViewHolder() is never being called








