如何在assemble后使用Android库。

huangapple go评论75阅读模式
英文:

How to use the android library after assemble

问题

我知道如何编写 Android 库。在编写之后,我会使用 assemble 命令构建 aar 文件。但是我不知道如何在我的项目中使用它。我在项目中有一个名为 FirstLibrary 的文件夹,但我不清楚如何使用它。在互联网上找不到任何关于这方面的 Android 官方文档。

你可以在我项目中 FirstLibrary 文件夹下面查看我创建的库。

如何在assemble后使用Android库。

英文:

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.

如何在assemble后使用Android库。

答案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.

huangapple
  • 本文由 发表于 2020年10月26日 10:22:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/64530743.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定