英文:
How to use the android library after assemble
问题
我知道如何编写 Android 库。在编写之后,我会使用 assemble
命令构建 aar
文件。但是我不知道如何在我的项目中使用它。我在项目中有一个名为 FirstLibrary
的文件夹,但我不清楚如何使用它。在互联网上找不到任何关于这方面的 Android 官方文档。
你可以在我项目中 FirstLibrary
文件夹下面查看我创建的库。
英文:
I know how to write Android library. And after writing I'm assemble
it to build aar
files. But how t use it in my project. I have FirstLibrary
folder in my project itself but I'm not getting how to use it. Android didn't gave any documentation anywhere on internet.
You can have a look at the library I created below FirstLibrary
inside my project.
答案1
得分: 1
你需要在应用级别的 build.gradle 中添加以下内容:
implementation project(':app:FirstLibrary')
库的名称可以在 settings.gradle
中找到。
如果你是手动创建的所有内容,那么你必须在 settings.gradle
中包含库的名称。如果你是通过面板自动生成的 Android 库,那么它会被自动添加进去。
英文:
you need to add this in app level build.gradle
implementation project(':app:FirstLibrary')
Library name can be found in settings.gradle
if you have created everything manually then you must have include the library name in settings.gradle
. If you have created android library by panel itself then it would be added automatically.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论