-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Avoid processing *.aar dependencies which can not be parsed and cause gradle failures #172
Avoid processing *.aar dependencies which can not be parsed and cause gradle failures #172
Conversation
if (resolvedArtifact.type != "pom") { | ||
return@forEach | ||
} | ||
|
||
val pomFile = resolvedArtifact.file | ||
val node = xmlParser.parse(pomFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the android gradle plugin < 7.1.0 following dependencies are getting resolved within our example project:
resolvedArtifact.id: vectordrawable-animated-1.1.0.pom (androidx.vectordrawable:vectordrawable-animated:1.1.0)
resolvedArtifact.type: pom
resolvedArtifact.file: /Users/flobetz/.gradle/caches/modules-2/files-2.1/androidx.vectordrawable/vectordrawable-animated/1.1.0/2c40e16427f4e94ea471526868ba5ac4bd13de6d/vectordrawable-animated-1.1.0.pom
with the android gradle plugin >= 7.1.0 following dependencies are getting resolved within our example project:
resolvedArtifact.id: vectordrawable-animated-1.1.0.pom (androidx.vectordrawable:vectordrawable-animated:1.1.0)
resolvedArtifact.type: pom
resolvedArtifact.file: /Users/flobetz/.gradle/caches/modules-2/files-2.1/androidx.vectordrawable/vectordrawable-animated/1.1.0/2c40e16427f4e94ea471526868ba5ac4bd13de6d/vectordrawable-animated-1.1.0.pom
-----
resolvedArtifact.id: vectordrawable-animated-1.1.0.aar (androidx.vectordrawable:vectordrawable-animated:1.1.0)
resolvedArtifact.type: aar
resolvedArtifact.file: /Users/flobetz/.gradle/caches/modules-2/files-2.1/androidx.vectordrawable/vectordrawable-animated/1.1.0/fcda1161354501471c30a4e077af6b5c4d4eddc6/vectordrawable-animated-1.1.0.aar
The gradle-license-plugin will obvously fail when trying to parse a .aar file which is currently done at L173
@jaredsburrows can you have a look at this please?
30255d2
to
6e4d4e9
Compare
6e4d4e9
to
b0b301e
Compare
… gradle failures With the Android gradle plugin 'com.android.tools.build:gradle:7.1.0' the dependency resolution changed and therefore different dependency types like '.aar' appear within the list of resolved artifacts/dependencies. These types have to be excluded before parsing a dependency to avoid failures. Currently .aar dependencies will cause following error: ``` > Task :app:licenseReleaseReport circularimageview dependency does not have a license. [Fatal Error] vectordrawable-animated-1.1.0.aar:1:1: Content is not allowed in prolog. > Task :app:licenseReleaseReport FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:licenseReleaseReport'. > org.xml.sax.SAXParseException; systemId: file:///home/user/caches/modules-2/files-2.1/androidx.vectordrawable/vectordrawable-animated/1.1.0/fcda1161354501471c30a4e077af6b5c4d4eddc6/vectordrawable-animated-1.1.0.aar; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 21s 11 actionable tasks: 5 executed, 6 up-to-date ```
b0b301e
to
57b7b0c
Compare
Thanks! I will work on a release soon! |
Starting with the Android gradle plugin
com.android.tools.build:gradle
version7.1.0
the dependency resolution changed and therefore different dependency types like '.aar' appear within the list of resolved artifacts/dependencies.These types have to be excluded before parsing a dependency to avoid failures.
Currently .aar dependencies will cause following error: