Android AAR第三方罐子 [英] Android AAR third party jars
问题描述
我已经使用Android Studio制作了AAR,我可以在任何应用程序中成功使用它。问题是我必须将需要手动的所有依赖项添加到应用程序build.gradle中(如编译'org.slf4j:slf4j-android:1.7.10')。
I have made an AAR using Android Studio and I can successfully use it in any app. Problem is I have to add all the dependencies it needs manually to the app build.gradle (like compile 'org.slf4j:slf4j-android:1.7.10').
我希望AAR实际上包含所有这些第三方依赖关系,因此我不必在应用程序中手动添加它们。有没有办法知道?
I want the AAR to actually include all these third-party dependencies it requires so I won't have to add them manually in the app. Is there a way you would know of?
推荐答案
如果你使用
compile fileTree(dir:'libs' '* .jar'])
并将一个jar放在libs文件夹中,这个jar将被包含在AAR中。
If you use
compile fileTree(dir: 'libs', include: ['*.jar'])
and put a jar in libs folder, this jar will be included in the AAR.
但你必须自己放瓶子。
据我所知,没有办法在AAR中放置存储库依赖项。
But you have to put the jar yourself. As far as I know, there is no way to put a repository dependency inside an AAR.
这篇关于Android AAR第三方罐子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!