Building .apk and .aar library from same project

筅森魡賤 提交于 2019-12-10 19:06:26

问题


is it possible to build an apk and an aar library with gradle from the same project source? Challenge is to modify the build.gradle so that both products will be built. Do you have any advice?


回答1:


Finally, Gradle offers me a really simple solution for this issue: I've created a multi module project with Android Studio and Gradle (see http://www.petrikainulainen.net/programming/gradle/getting-started-with-gradle-creating-a-multi-project-build/). One module for the app (Android Application Project) and one for the library (Android Library Project).

After moving all sources, that belong to the library, to the library project, I'm able to build the .aar file and the .apk file (which uses also sources from the library project, no problem thanks to the multi module project).



来源:https://stackoverflow.com/questions/34314610/building-apk-and-aar-library-from-same-project

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