Scroll to the last of the page using appium espresso

I am using espresso.I have to scroll to last of the page. I am not able to use data matchers because there is not adapter view. I get the following error when I use data matcher.
*Original error: androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: is assignable from class: class android.widget.AdapterView*

I also tried using mobile:scrollToPage but it does not work. I am getting the following error in this case.

Could not scroll to page. Reason: androidx.test.espresso.PerformException: Error performing 'ViewPager move to last page' on view 'Looked for element with View{dc69d1b VFED..C.. ........ 84,2995-1356,3177 #7f0a0074 app:id/btn_next}'.