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)
3)在Manifest.xml的application标签下添加 tools:replace="android:icon, android:label,android:theme"
(我用了没用,别人用过有用这个)
方法二:
在build.gradle根标签上加上useOldManifestMerger true (懒人方法)
但是上边的方法并没有解决我的问题,后来通过检查AndroidManifest.xml文件,发现、
被重复声明了两次,去掉其中一个就可以了,问题解决。
问题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;
转自https://blog.csdn.net/wangwasdf/article/details/73480411
希望大家也觉得有用。
更多相关文章
- “罗永浩抖音首秀”销售数据的可视化大屏是怎么做出来的呢?
- Nginx系列教程(三)| 一文带你读懂Nginx的负载均衡
- 不吹不黑!GitHub 上帮助人们学习编码的 12 个资源,错过血亏...
- Android(安卓)Annotations(1)
- Android(安卓)Studio--使用Toast
- android--使用NDK-build生成so
- Android(安卓)开发笔记
- android功耗(9)----MTK功耗问题需要哪种log
- Android-Toast的使用方法详解