android杂记-三方依赖(清单合并失败,aar)

一、与依赖清单合并失败(Studio导入有依赖关系的Eclipse项目时出现的问题)

1.

问题:Error:Execution failed for task ':smartfridgenation:processDebugManifest'.

          > Manifest merger failed with multiple errors, see logs

解释:项目与依赖冲突,清单合并失败

解决:application标签下添加tools:replace="icon",有时需要添加tools:replace="icon,theme",有的情况需要添加

tools:replace="android:name",添加什么由冲突项决定。

(build.gradle里面android标签上加上useOldManifestMerger true,本人用此方法报错)

个人情况记录:

本人开始报icon冲突,添加tools:replace="icon",继续报错:

 
,一顿操作之后,提示添加

tools:replace="android:name",添加之后解决,原因未知。。。

二、studio使用aar
1.aar放到libs文件下
2.Module的build.gradle根目录下添加

repositories { flatDir { dirs 'libs' } }

3.

dependencies{
compile(name: 'arr的名称', ext: 'aar')

}
4."Build"-->"rebuild project"
rebuild完成后就能在app-build-intermediates-exploded-aar目录下看到aar中完整项目
三、出错场景:集成aar,跳转aar内页面报错
Unable to start activity ComponentInfo{com.example.vtion.lanzhanggui/com.yuancore.kit.modular.main.view.activity.YCoreVideoCaptureActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
解决:在value-styles的AppTheme中添加

false
true

 

你可能感兴趣的:(android杂记-三方依赖(清单合并失败,aar))