现在的SDK基本上都会封装成AAR来发布,但是有个问题,如果你的AAR还引用了其它的AAR,导出的时候并不会自动把引用的AAR也集成进去,别人使用你的AAR的时候,还需要再把你引用的AAR再导入一次。
如果你的SDK再供给其它SDK,这种集成问题就比较蛋疼了。有没有办法把引用的AAR集成到你的AAR里呢。
有一个比较繁琐的办法,就是把aar包解压,aar里面可能包含了res,AndroidManifest.xml,jni,jar包等,分别把这些手动合并到你的AAR工程里。
除了这个繁琐的办法,Android Studio有没有提供一个简单可行的办法,自动集成进去呢,google了一圈,在stackoverflow上找到了如下答案:
There is no mechanism to combine library. It's a bit complicated as you probably want to control which dependencies get merged (for instance you probably don't want to include support-v4 in there). Also you'd need to merge the resources and Android manifest.
At this time there's no way to easily hack something, unless you are su