I have an android base project where I have some reusable module so that I can use them in any projects, I have 4 module dependency such as -
- moduleOne
- moduleTwo
- moduleThree
- moduleFour
Where I have defined in moduleThree's gragle -
implementation project(':moduleOne')
implementation project(':moduleTwo')
implementation project(':moduleFour')
It means I am using all 3 modules in moduleThree.
And in my project gradle file I have defined like this -
implementation project(':moduleOne')
implementation project(':moduleTwo')
implementation project(':moduleThree')
implementation project(':moduleFour')
And in my app's setting.gradle file -
include ':app', ':moduleOne', ':moduleTwo', ':moduleThree', ':moduleFour'
So as of now I am using in my application as a module for that I have to copy the folder and then I have pasted in my original project. I found it's a tedious job so I decided to create an aar file and directly use them in my project.
But when I am putting all four aars in my project B I am not able to access it's resources files, it's throwing some exception - Android Resources linking failed. Jetified. I have tried
- Clean the project
- Invalidate cache and restart
- Rebuild the project
- delete build folder
So my problem is except providing all the modules I want to provide only aar files and then any project can add them as a dependency. I have already generated aar file but facing a problem to run the project -
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:TagsEditText="http://schemas.android.com/apk/res-auto"
android:id="@+id/sv_scan_description"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.example.moduleThree.ui.TagsEditText
android:id="@+id/tagsEditText"
style="@style/TextEditTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
TagsEditText:tagsBackground="@drawable/send_to_email_bg"
---/>
</ScrollView>
AAPT: error: attribute tagsBackground (aka com.example.myproject:tagsBackground) not found.
Note- generated Aar files were moduleOne-debug.aar and moduleOne-release.aar and I renamed release one to moduleOne.aar and used in project. Is it ok?