我试图制作自己的" lib"使用Android Studio。我已生成aar文件并将其包含在我的测试项目中。在我的build.gradle中,我添加了:
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'mysdk_name', ext:'aar')
}
在我的测试项目的清单中,我添加了工具: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中找到那些attrs。所以我的问题是如何将多个模块包含在.aar中?