Cannot resolve aar project dependencies for task 'lint' on a clean project (race condition?)
bergetp opened this issue · comments
Hi,
Thank you for maintaining this, hopefully this will be solved in the official gradle plugin soon!
We are having an issue with running 'build' on a clean project. The dependency resolution for the lint task isn't able to resolve the dependencies.
How to reproduce
- Go to examples
- Run
rm -rf build; rm -rf lib-aar2/build; rm -rf lib-aar/build; rm -rf lib-main/build; ./gradlew clean lib-main:build
Workaround
One workaround I found was to remove the line which adds the 'embed' dependencies to project dependencies and declare the dependencies twice (once with 'embed' and once with 'api'). like this:
embed project(path: ':lib-aar2', configuration:'default')
api project(':lib-aar2')
To me this indicates that there is some sort of race condition? Are the dependencies added too late to the project when using the listener?
Failure message
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':lib-main:lint'.
> Could not resolve all artifacts for configuration ':lib-main:flavor1ReleaseCompileClasspath'.
> Failed to transform lib-aar.aar (project :lib-aar) to match attributes {artifactType=android-manifest}.
> Execution failed for IdentityTransform: /Users/pberglund/src/fat-aar-android-spotify/example/lib-aar/build/outputs/aar/lib-aar-release.aar.
> Expecting a file or a directory: /Users/pberglund/src/fat-aar-android-spotify/example/lib-aar/build/outputs/aar/lib-aar-release.aar
> Failed to transform lib-aar2.aar (project :lib-aar2) to match attributes {artifactType=android-manifest}.
> Execution failed for IdentityTransform: /Users/pberglund/src/fat-aar-android-spotify/example/lib-aar2/build/outputs/aar/lib-aar2-release.aar.
> Expecting a file or a directory: /Users/pberglund/src/fat-aar-android-spotify/example/lib-aar2/build/outputs/aar/lib-aar2-release.aar
Versions
fat-aar version: 1.2.13
Thank you for the feedback.
I fixed it in latest version.
Please try to use fat-aar version 1.2.15.
Thank you, it works! Added a follow up PR.
How did you figure it out btw? Are there any detailed release notes on changes for 4.0.0?