我面临的错误:我使用最新的Android Studio版本4.0.0,无法同步gradle,因此我升级了最新的gradle版本6.5.1并放置在路径[c / program files / android / gradle / gradle 6.5中.1 /] .... iam更新后仍无法同步错误。.任何人都可以帮助我解决这个错误Blockquote
答案 0 :(得分:0)
您可以删除 mRecyclerView.addOnScrollListener ( new RecyclerView.OnScrollListener ( ) {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
visibleItemCount = layoutManager.getChildCount();
totalItemCount = layoutManager.getItemCount();
pastVisibleItems = layoutManager.findFirstVisibleItemPosition();
if(dy>0)
{
if(isLoading){
if (totalItemCount>previous_total){
isLoading = false;
previous_total = totalItemCount;
}
}
if (!isLoading&&(totalItemCount-visibleItemCount)<=(pastVisibleItems+view_threshold))
{
page_number++;
performPagination();
isLoading = true;
progressBar = findViewById ( R.id.progressBar );
progressBar.setIndeterminate (true);
progressBar.setVisibility(View.VISIBLE);
}
}
if(dy > 0 && bottomNavigationView.isShown ()){
bottomNavigationView.setVisibility ( View.GONE );
}else if(dy < 0){
bottomNavigationView.setVisibility ( View.VISIBLE );
}
}
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged ( recyclerView, newState );
}
} );
然后升级
/project_directory/.gradle folder
classpath 'com.android.tools.build:gradle:4.0.1'
-确保您停止 FYI
或 FireWall
最后 Anti- Virus