Home » Android » Android Applications » Solved Error: Must be one of: RecyclerView.HORIZONTAL, RecyclerView.VERTICAL [WrongConstant]

Solved Error: Must be one of: RecyclerView.HORIZONTAL, RecyclerView.VERTICAL [WrongConstant]

When we were compiling our app source code with “./gradlew clean build” we got following error,

 Error: Must be one of: RecyclerView.HORIZONTAL, RecyclerView.VERTICAL [WrongConstant]
          layoutMngr.orientation = androidx.recyclerview.widget.LinearLayoutManager.VERTICAL

Solution to this compilation error is,

open your source code and change LinearLayoutManager.VERTICAL to RecyclerView.VERTICAL

So, the final source code should look like,

layoutMngr.orientation = androidx.recyclerview.widget.RecyclerView.VERTICAL
android collapsing toolbar with ima...
android collapsing toolbar with image and recyclerview example

Leave a Comment

Sign up to our newsletter!