android - 构建 aar 模块

标签 android aar

我第一次构建 aar 模块。我能够将我的应用程序转换为 aar 模块。我创建了另一个新应用程序,并将此 aar 文件添加到项目中。但是,我遇到了这个错误。

Error:(9) No resource identifier found for attribute 'civ_border_color' in package 'com.example.com'

我已经搜索了答案,推荐喜欢 更换 xmlns:app="http://schemas.android.com/apk/res-auto" 和 xmlns:app="http://schemas.android.com/apk/lib-auto"或 xmlns:app="http://schemas.android.com/apk/com.example.com"

我试过了。我注意到有错误的文件是自动生成的文件,我不应该更改它们。是否有任何我错过了创建 aar 文件的步骤。 BTW,aar文件编译成功。任何我遗漏的有用信息,请指出。不投反对票。因为我真的不知道我错过了什么。谢谢。

最佳答案

你加了吗

repositories {
  flatDir {
     dirs 'libs'
  }
}

在您项目的 build.gradle 中?

你加了吗

compile(name: 'xxx', ext: 'aar')。

在模块的 build.gradle 中?

关于android - 构建 aar 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40103852/

相关文章:

gradle - 将 eclipse android 库项目上传到 maven Central

android - 如何将 Android 库导出为 .aar 并保留我的 Gradle 依赖项?

android - 将 AndroidX 库包含到 Unity 项目中

java - Dagger 2 多重绑定(bind)教程的@AutoAnnotation 不起作用。如何让它发挥作用?

java - 无法将 JSON 数据发送到其他 Android Activity

android - 无法在 Android 中找到 PCLstorage 路径

java - 重写非 Activity 类中的方法,Android

java - 使用 HttpURLConnection 读取 session 变量

android-studio - Android Studio:如何将.aar库链接到多个项目?

java - 在.aar文件Android中添加gradle依赖项(build.gradle)