升级Android后遇到问题,解决方法记录

下午找同学帮忙调bug,但对方发过来的工程我打不开,因为gradle的问题(大概),总之最后升级了android,新的项目是打开了,运行也没问题,但是我之前的总项目运行不了了
遇到的第一个问题:

Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()

在最后我总算解决了,解决步骤:
1、将旧的项目这个地方,修改为新的,把新的直接复制就行了
在这里插入图片描述
2、之后并没有完全解决问题,出现了一下报错

Could not find com.android.tools.build:gradle:4.1.1.

Searched in the following locations:

  - https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom

If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.

Required by:

    project :

Add google Maven repository and sync project

Open File

最后在后面加上了google()
在这里插入图片描述

3、但是接着出现了新的报错

Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager

命运多舛啊,继续寻找解决方案
参考csdn大佬的文章:
复制一个文件,改名字and so on。。。。

4、到这里我的旧项目终于回来看我了,呜呜呜,感激涕零啊

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在ViewPager中嵌套ListView时,可能会遇到ListView无法滑动的问题,这是因为ViewPager会拦截ListView的滑动事件。解决方法如下: 1. 自定义ListView,重写其onInterceptTouchEvent()方法,返回false,让ViewPager不拦截ListView的滑动事件。 ``` public class MyListView extends ListView { public MyListView(Context context) { super(context); } public MyListView(Context context, AttributeSet attrs) { super(context, attrs); } public MyListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { final int action = ev.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: setParentScrollAble(false); break; case MotionEvent.ACTION_UP: setParentScrollAble(true); break; } return super.onInterceptTouchEvent(ev); } private void setParentScrollAble(boolean flag) { getParent().requestDisallowInterceptTouchEvent(!flag); } } ``` 2. 在ViewPager的适配器中,将ListView所在的布局设置为android:descendantFocusability="blocksDescendants",防止ListView获取焦点而导致ViewPager无法滑动。 ``` <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:descendantFocusability="blocksDescendants"> <com.example.MyListView android:id="@+id/listView" android:layout_width="match_parent" android:layout_height="match_parent"/> </LinearLayout> ``` 以上两种方法都可以解决ViewPager中ListView失效的问题

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值