Including AAR lib compile error: no resource identifier found

Including AAR lib compile error: no resource identifier found

我正在尝试使用 Android Studio 制作自己的 "lib"。我已经生成了 aar 文件并将其包含到我的测试项目中。在我的 build.gradle 中,我添加了:

repositories {
    flatDir {
        dirs 'libs'
    }
} 
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile(name:'mysdk_name', ext:'aar')
}

在我的测试项目清单中,我添加了 tools:replace="android:theme"。 我可以使用导入的 aar 中的 类,但是当我编译我的项目时出现错误:

Error:(14) No resource identifier found for attribute 'fillColor' in package 'my_package_name'
Error:(14) No resource identifier found for attribute 'pageColor' in package 'my_package_name'

等等。这是我在出现错误的 .aar 项目中的代码:

<com.viewpagerindicator.CirclePageIndicator
    android:id="@+id/tutorial_images_indicator"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_margin="@dimen/dimen_8"
    app:fillColor="@color/tutorial_pager_fill_color"
    app:pageColor="@color/tutorial_pager_page_color"
    app:radius="@dimen/dimen_4"
    app:strokeWidth="0dp"/>

我应该怎么做才能修复这些错误?

编辑: 在我的主要应用程序使用的外部模块中定义的属性。我以为 Android Studio 会自动将该模块添加到生成的 .aar 中,但我在 .aar 中找不到该属性。所以我的问题是如何将多个模块包含到 .aar 中?

所以我终于想通了。我的问题是我的 .aar 不包含来自外部模块的资源。 我已经使用 android-fat-aar 脚本来解决这个问题。