google / google/bundletool

Error: Version must match the format '<major>.<minor>.<revision>[-<qualifier>]', but found '0.0.0/'

Open
#331 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
4k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Version of bundle: 1.15.0

[BT:1.15.0] Error: Version must match the format '..[-]', but found '0.0.0/'.
java.lang.IllegalArgumentException: Version must match the format '..[-]', but found '0.0.0/'.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:220)
at com.android.tools.build.bundletool.model.version.Version.of(Version.java:67)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
at com.android.tools.build.bundletool.archive.ArchivedResourcesHelper.findArchivedClassesDexPath(ArchivedResourcesHelper.java:105)
at com.android.tools.build.bundletool.transparency.CodeTransparencyFactory.createArchivedCodeRelatedFile(CodeTransparencyFactory.java:72)
at com.android.tools.build.bundletool.transparency.CodeTransparencyFactory.createCodeTransparencyMetadata(CodeTransparencyFactory.java:56)
at com.android.tools.build.bundletool.commands.AddTransparencyCommand.executeGenerateCodeTransparencyFileMode(AddTransparencyCommand.java:341)
at com.android.tools.build.bundletool.commands.AddTransparencyCommand.execute(AddTransparencyCommand.java:282)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:138)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:55)

Repro steps:
I cannot repro this locally, but I am able to repro this on Azure Devops pipeline. I suspect that this is caused by some weird behavior of the Windows pipeline agent that I am using. The path to `/com/android/tools/build/bundletool/archive/dex/0_0_0` contains a trailing slash somehow on some operating systems, so eventually the version is parse as "0.0.0/" instead of "0.0.0". Can we add some extra logic to remove the slash from the path to the dex resource files?

Bundletool command that I used:
java -jar bundletool-1.15.0-all.jar add-transparency --mode=generate_code_transparency_file --bundle=app-release.aab --output=code_transparency_file.jwt --transparency-key-certificate=certificate.p7b

Apologize for providing less details on the command and dependent files.

I've got an example Pull Request to resolve this issue: #332

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.