Android studio 如何在android studio中将.aar文件添加到gradle.kts?

Android studio 如何在android studio中将.aar文件添加到gradle.kts?,android-studio,kotlin,gradle-kts,Android Studio,Kotlin,Gradle Kts,实现(fileTree(mapOf(“dir”到“libs”,“include”到listOf(“*.jar”))) 实现(文件(“BudgetLibraryNBB.aar”)推荐方法是使用文件导入它,然后在库模块build.gradle.kts文件中引用它: implementation(project(":BudgetLibraryNBB")) 如果将其放入libs dir: implementation(files("./libs/BudgetLibrary

实现(fileTree(mapOf(“dir”到“libs”,“include”到listOf(“*.jar”)))


实现(文件(“BudgetLibraryNBB.aar”)

推荐方法是使用
文件导入它,然后在库模块
build.gradle.kts
文件中引用它:

implementation(project(":BudgetLibraryNBB"))
如果将其放入libs dir:

implementation(files("./libs/BudgetLibraryNBB.aar"))

在执行BundleAr任务时,您将遇到以下错误:

Execution failed for task ':common:bundleDebugAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The 
resulting AAR would be broken because the classes and Android resources from any 
local .aar file dependencies would not be packaged in the resulting AAR. Previous 
versions of the Android Gradle Plugin produce broken AARs in this case too 
(despite not throwing this error). The following direct local .aar file 
dependencies of the :common project caused this error: 


这非常简单,只需在
文件树中包含
*.aar

实现(fileTree(mapOf(“dir”到“libs”,“include”到listOf(“*.jar”,“*.aar”)))


当然,如果你仍然将你的库保存在libs文件夹中,我在libs文件夹中有.aar文件,我想导入libs文件夹中当前的.aar文件以包含在主项目中。请注意,我使用的是Gradle.kts文件系统。我只是尝试使用许多在线解决方案,但到目前为止,它似乎不是wokring。如果有人可以检查这一点。下面是给定的问题
Execution failed for task ':common:bundleDebugAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The 
resulting AAR would be broken because the classes and Android resources from any 
local .aar file dependencies would not be packaged in the resulting AAR. Previous 
versions of the Android Gradle Plugin produce broken AARs in this case too 
(despite not throwing this error). The following direct local .aar file 
dependencies of the :common project caused this error: