Android 报错汇总

1.安装时提示“应用组件的命名与已安装应用有冲突”

出现这个问题是用于同一套代码打了两个applicationId的包,而手机上已经安装了其中一个,安装另外一个时就会报错。其原因是Manifast中配置的ContentProvider中的authorities没有更改,致使两个不同applicationId的authorities相同

2.Error while generating the main dex list

打包时报了这个错,详细报错情况如下:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForRelease'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

具体是哪个包冲突了可以再RunTask中找到

3.More than one file was found with OS independent path

在出错的Model的gradle的android节点下添加

packagingOptions {
        pickFirst 'META-INF/*'
    }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容