在 Android 项目中作为模块导入和添加时的 AAR 文件更新
AAR file updation when imported and added as a module in an Android project
我通过导入创建模块的 aar
文件来使用库。然后将此模块添加为依赖项。
我为我在我的应用程序中使用的库之一做了这件事,它运行良好。但是现在我想更新到最新版本的库我对以下内容感到困惑:
我如何知道我使用的是哪个版本?不记得我导入 aar
文件时的版本。有办法检查吗?
我想用最新版本更新 aar。我怎么做?我只是重新导入它会覆盖吗?还是删除现有模块并重新导入?
我在 SO 上只找到这个 post 相关的,它没有回答以上两个问题中的任何一个。它提出了另一种使用 aar 的方法,但我想知道如何继续使用 import aar 方法。
有问题的 aar 文件是 millennial-media
的文件
How do i find out which version I'm using? Don't remember what the version was when i imported the aar file. Is there a way to check this?
没有标准的方法来了解您的 aar 版本。
您可以使用 aar 中的名称或文件,也可以简单地使用 doc.
I want to update the aar with its latest version. How do i do that? Do i simply re-import and it will overwrite? or do i delete the existing module and import again?
您可以简单地覆盖 aar 文件。
导入aar文件意味着:
- 复制文件夹中的aar文件
- 在
build.gradle
中添加依赖项和存储库
类似的东西:
repositories {
flatDir {
dirs 'libs'
}
}
并添加依赖:
dependencies {
compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
}
更新时,复制aar文件覆盖现有文件即可。
我建议您使用 maven 依赖项。在这种情况下,有人将库上传到 Maven 存储库中。
目前这是我认为最好的解决方案。
在这种情况下,只需在您的项目中添加一个依赖项
dependencies{
compile 'group:name:version'
}
并且知道版本和更新库非常简单。
我通过导入创建模块的 aar
文件来使用库。然后将此模块添加为依赖项。
我为我在我的应用程序中使用的库之一做了这件事,它运行良好。但是现在我想更新到最新版本的库我对以下内容感到困惑:
我如何知道我使用的是哪个版本?不记得我导入
aar
文件时的版本。有办法检查吗?我想用最新版本更新 aar。我怎么做?我只是重新导入它会覆盖吗?还是删除现有模块并重新导入?
我在 SO 上只找到这个 post 相关的,它没有回答以上两个问题中的任何一个。它提出了另一种使用 aar 的方法,但我想知道如何继续使用 import aar 方法。
有问题的 aar 文件是 millennial-media
的文件How do i find out which version I'm using? Don't remember what the version was when i imported the aar file. Is there a way to check this?
没有标准的方法来了解您的 aar 版本。
您可以使用 aar 中的名称或文件,也可以简单地使用 doc.
I want to update the aar with its latest version. How do i do that? Do i simply re-import and it will overwrite? or do i delete the existing module and import again?
您可以简单地覆盖 aar 文件。
导入aar文件意味着:
- 复制文件夹中的aar文件
- 在
build.gradle
中添加依赖项和存储库
类似的东西:
repositories {
flatDir {
dirs 'libs'
}
}
并添加依赖:
dependencies {
compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
}
更新时,复制aar文件覆盖现有文件即可。
我建议您使用 maven 依赖项。在这种情况下,有人将库上传到 Maven 存储库中。
目前这是我认为最好的解决方案。
在这种情况下,只需在您的项目中添加一个依赖项
dependencies{
compile 'group:name:version'
}
并且知道版本和更新库非常简单。