1

First time i build an aar module. I am able to convert my app into an aar module. And i create another new app, and add this aar file into the project. However, I encountered this error.

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

I have searched for the answer, and recommendation like replacing xmlns:app="http://schemas.android.com/apk/res-auto" with xmlns:app="http://schemas.android.com/apk/lib-auto" or xmlns:app="http://schemas.android.com/apk/com.example.com"

I have tried. And i notice the files that have error, are auto generate files, i am not suppose to change them. Is there any steps that i have missed out creating the aar file. BTW, the compilation of the aar file is successful. Any useful information that i missed out , please do point out. Not vote down. Coz i really have no idea what I have missed out. Thanks.

kggoh
  • 742
  • 1
  • 10
  • 24

2 Answers2

1

Did you add

repositories {
  flatDir {
     dirs 'libs'
  }
}

in your project's build.gradle?

Did you add

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

in your module's build.gradle?

Qian Sijianhao
  • 564
  • 7
  • 19
  • i didn't add anything manually, only use this [Link]http://stackoverflow.com/questions/29826717/how-to-import-a-aar-file-into-android-studio-1-1-0-and-use-it-in-my-code – kggoh Oct 18 '16 at 09:10
  • I check the gradle files, it does not have what you stated above. – kggoh Oct 18 '16 at 09:10
  • Then you should add both of the code above into your build.gradle. – Qian Sijianhao Oct 18 '16 at 09:13
  • still not working. I check. build gradle has compile project(':sdk-debug') and i have added flatDir { dirs 'libs' } – kggoh Oct 18 '16 at 09:13
0

I found the answer. To give a hand for anyone that facing this issue. When building your aar module. Make sure the layout is change from

xmlns:app="http://schemas.android.com/apk/res-auto"

to

xmlns:app="http://schemas.android.com/apk/lib-auto"

Compile the module, and then add this module to a new project. (The issue solved, I am now encounter different error now, gonna post another question.) Thanks.

kggoh
  • 742
  • 1
  • 10
  • 24