项目需求,需要引入一个arr
1.把.arr放入libs目录下,同时在builde.gradle中dependencies{
compile(name: 'xxxxxx', ext: 'aar')}
同步,build项目
2..jar的冲突:
确保你整个项目中,包括app,各种moudle,或者其他的arr中,确保只要一个jar,(同个项目中引用的依赖库,或者是moudle,arr中jar.都可以识别到,所以确保只有一个就行)
报错:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForxxxxxDebug'.
> java.io.IOException: Can't write [D:\git_resp\xxxxx\app\build\intermediates\multi-dex\xxxxx\debug\componentClasses.jar] (Can't read [C:\Users\Administrator\.gradle\caches\transforms-1\files-1.1\xxxx.aar\cc21b21e7763d35b89e617f7ea60c1d9\jars\libs\fastjson-1.1.34.android.jar(;;;;;;**.class)] (Duplicate zip entry [fastjson-1.1.34.android.jar:com/alibaba/fastjson/serializer/SerializerFeature.class]))
3.编译通过后:进入集成的项目中报错:
java.lang.NoSuchFieldError: No field mainUI_bottomLayout_layout01 of type I in class Lcom/app/xxx/R$id; or its superclasses (declaration of 'com.app.xxx\.R$id' appears in /data/app/com.xxx.app-1/base.apk:classes2.dex
原因是:在整个项目中,不同moudle中存在相同名字的layout文件,jvm加载会出现异常,\
解决:修改layout文件名称
4.集成的arr中也引用了arr包,里面的arr是打入不了的,需要在项目中单独集成这个嵌套的arr