Android 开发过程中遇到的问题Error:Execution failed for task ':app:processDebugManifest'

在开发过程中遇到了这样一个问题:

问题1:

Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed with multiple errors, see logs

在网上查到了一些这个问题的解决办法:

方法一:

1)在Manifest根标签加上 xmlns:tools="http://schemas.android.com/tools"

2)<user-sdk tools:overrideLibrary="自己需要强制替换的库"/>

3)在Manifest.xml的application标签下添加 tools:replace="android:icon, android:label,android:theme"

方法二:

在build.gradle根标签上加上useOldManifestMerger true (懒人方法)


但是上边的方法并没有解决我的问题,后来通过检查AndroidManifest.xml文件,发现、

<meta-data android:name="UMENG_APPKEY" android:value="*****">

被重复声明了两次,去掉其中一个就可以了,问题解决。

问题2:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.>

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/appcompat/R$anim.class

报了这个问题,因为v7包冲突的问题,检测了整个项目,发现v7并没有冲突。后来再网上看到说是因为gradle wrapper的问题。 在项目根目录下执行命令:gradlew clean即可(./代表根目录)。

问题3:

RecyclerView在更新数据是,出现:java.lang.IllegalArgumentException Scrapped or attached views may not be recycled. isScrap:false isAttached:true

问题是因为在获取新数据事将数据集合清除了,但是没有notifyDataSetChanged.可以将清除集合操作在获取数据之后将原来的集合清除,然后再将新数据加到集合中调用adapter的notifyDataSetChanged()方法.

问题4:

最近一个朋友问我一个问题:Toast中的内容不居中显示,一开始他传入的Context是Activity,我让他修改成getBaseContext()、getApplicationContext()都不行。后来查找到在Application 配置的主题中设置了fitsSystemWindows=true ,注释掉就可以了。

问题5:

最近以为群友出现了一个问题:Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not requestWindow.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

提示添加toolbar失败,已经存在了actionbar。

解决办法:

方式一:将主题替换为NoTitleBar主题;

方式二:将当期主题的notitle设置为true;

  • 5
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值