Skip to content
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

The aar output file is renamed to something different #95

Open
StefMa opened this issue Feb 25, 2019 · 0 comments
Open

The aar output file is renamed to something different #95

StefMa opened this issue Feb 25, 2019 · 0 comments

Comments

@StefMa
Copy link
Owner

StefMa commented Feb 25, 2019

Thanks to @lukaszkalnik we found out that the aar output file is renamed in a specific combination of the AGP and Gradle version.
They renamed the file from XY-buildType to XY-version.
I found out this happend with the AGP 3.3.1 and Gradle 5.1+.
Therefore this is not guaranteed anymore and break the build.

Anyway. Depending on a hardcoded output path is not recommended by Gradle anyway.
This code

artifact("${project.buildDir}/outputs/aar/${variantName.aarFileName(project.name)}") {
will break.
Because the output is not named xy-release.aar anymore but xy-1.0.0.aar.
But I found out that the bundleReleaseAar has declared the output path:

afterEvaluate {
  println(tasks.getByName("bundleReleaseAar").outputs.hasOutput)
  tasks.getByName("bundleReleaseAar").outputs.files.forEach {
    println(it)
  }
}

true
/private/tmp/[aproject]/[aproject]/build/outputs/aar/blewifiprov-0.1.0.aar

That means we could add the artifact from this output instead of adding a hardcoded string...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant