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 
Follow Lynxbee

Leave a Reply / Ask Question