New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composite build exception when adding a library module dependency from the second build #28357
Comments
Your issue appears to be a question about how to use Gradle. They should be asked in a different channel, so we will close it. Your question might be answered in Gradle documentation or on our community Slack or forums. Find links to these resources on help.gradle.org. If you think our analysis is wrong, please provide us with more detailed information explaining why. You are supposed to use |
I still think the issue lies in composite builds. The documentation provides sample of using binary libraries (JAR, AAR) - Defining a composite build:
The problem I am having is using the Android library module as code, not as JAR/AAR. |
Then try to include those projects in your build without composite builds, using regular |
These modules are in two separate projects. Composite builds include a separate build via I would not post here unless I am really stuck. I think this in issue with Gradle (or Android Gradle plugin). Still nothing from Android team - https://issuetracker.google.com/issues/328115462. No fun :( |
I stand corrected. Adding Thanks to the responds which nudged me to the right direction - https://gradle-community.slack.com/archives/CAHSN3LDN/p1709760926133779 |
@dimitar71 Sorry for misleading you. Glad you resolved the issue. The comment in the thread is right: the documentation on the composite builds should be improved. Thus, I'm reopening this as a documentation issue. |
Current Behavior
MyApplication
..
app
Android application module......
build.gradle
..
api
- Android library module......
build.gradle
..
settings.gradle
SharedLibraries
..
app
Android application module......
build.gradle
..
shared-library
- Android library module......
build.gradle
..
settings.gradle
MyApplication/settings.gradle
hasincludeBuild("../SharedLibraries")
.I want to have a
SharedLibraries/shared-library
dependency inMyApplication/api/build.gradle
When I add in
MyApplication/api/build.gradle
this line:implementation(project(":SharedLibraries:shared-library"))
I get this exception
Attached is a screenshot of the project structure.
Expected Behavior
Library module dependency from a
includeBuild()
project should be valid and used as expected.Context (optional)
No response
Steps to Reproduce
Please open
MyApplication
project from Android Studio and try toFile > Sync Project with Gradle Files
.Exception will be shown in
Build
window.Here is the project zip - composite_build_exception.zip
Gradle version
8.6
Build scan URL (optional)
No response
Your Environment (optional)
Android Studio Iguana
Mac OS Sonoma 14.3.1
The text was updated successfully, but these errors were encountered: