Android dependencies : apklib vs aar files

送分小仙女□ 提交于 2019-12-03 14:57:22

问题


From my understanding, apklib contains code + resource shared with Maven . aar files are distributed by Gradle.

The aar differ from apklib in one major way : classes are compiled and included in a classes.jar in the root of the aar. Whereas apklib cannot contain compiled class files or jars.

1 Can somebody explain the main differences between apklib vs aar files ?

2 Can Maven use aar ? Can Gradle use apklib ?

3 Which format is "better" ?


回答1:


1 Can somebody explain the main differences between apklib vs aar files ?

Couple differences that come to my mind, in addition to the ones you mentioned

  1. aar doesn't contain source code
  2. aar can contain custom proguard file and custom lint rules

2 Can Maven use aar ? Can Gradle use apklib ?

The Android Maven Plugin supports aar since version 3.7.0. Gradle doesn't support using apklib dependencies but you could export your android-library as apklib (see this post).



来源:https://stackoverflow.com/questions/22657466/android-dependencies-apklib-vs-aar-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!