I have been trying to add a library project as a dependency to another library project in Android Studio without success. Below is my project structure:
- apps
- demo (depends on android utilities & android ui)
- libraries
- android utilities
- utilities
- android ui
- ui (depends on android utilities)
I used the following as guide Add local Library Project as a dependency to multiple Projects in Android Studio
android utilities/build.gradle
...
android utilities/utilities/build.gradle
apply plugin 'com.android.library'
...
android ui/settings.gradle
include ':ui'
include ':utilities'
project(':utilities').projectDir = new File(settingsDir, '../android utilities/utilities')
android ui/build.gradle
...
android ui/ui/build.gradle
apply plugin 'com.android.library'
...
dependencies {
compile project(':utilities')
}
I have both Android Utilities and Android Ui setup as separate projects, I am able to compile the Android Utilities project without issues. But, I am not able to compile the separate Android Ui project. Android Studio itself doesn't indicate any errors, but gradle produces multiple errors about packages from the utilities library not existing.