question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception during build-bundle when parts of the output path doesn't exist

See original GitHub issue

Describe the bug When running build-bundle it seems that bundletool fails with an exception when a folder along the output path doesn’t exist yet. My build crashed on CI but was working fine locally, and the only difference I found was that the last step on the output path (android, as seen in the stacktrace below) didn’t exist on CI yet. Once I changed my pipeline to create that folder bundletool worked just fine.

Bundletool version(s) affected Version: 1.2.0

Stacktrace

[BT:1.2.0] Error: java.nio.file.NoSuchFileException: /var/folders/xk/4xx_qglx49gbgckw1mskrc0r0000gp/T/ZipBuilder-3357403704097616359.zip.tmp -> /Users/macpro/jenkins/workspace/frontend/BuildPipeline/builds/android/Client-0.59.0--6.aab
java.io.UncheckedIOException: java.nio.file.NoSuchFileException: /var/folders/xk/4xx_qglx49gbgckw1mskrc0r0000gp/T/ZipBuilder-3357403704097616359.zip.tmp -> /Users/macpro/jenkins/workspace/frontend/BuildPipeline/builds/android/Client-0.59.0--6.aab
	at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:261)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:71)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:47)
Caused by: java.nio.file.NoSuchFileException: /var/folders/xk/4xx_qglx49gbgckw1mskrc0r0000gp/T/ZipBuilder-3357403704097616359.zip.tmp -> /Users/macpro/jenkins/workspace/frontend/BuildPipeline/builds/android/Client-0.59.0--6.aab
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:457)
	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
	at java.nio.file.Files.move(Files.java:1395)
	at com.android.tools.build.bundletool.io.ZipBuilder.writeTo(ZipBuilder.java:107)
	at com.android.tools.build.bundletool.io.AppBundleSerializer.writeToDisk(AppBundleSerializer.java:115)
	at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:259)
	... 2 more

exit code: 1

To Reproduce Call bundletool build-bundle --output="/some/output/path/bundle.aab" with a path where the last subfolder doesn’t exist yet.

Expected behavior Bundletool should create the output folder when it doesn’t exist, similarly to how it’s done at BuildApksCommand.java#L650.

Known workaround The workaround is making sure that the folder exists prior to calling bundletool 😉

Environment: OS: OSX 10.15.7

Additional context I’m using bundletool in Unity with the Google PAD plug-in, but I don’t think this makes a difference at all.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ymakhnocommented, Nov 18, 2020

Thank you for the contribution!

0reactions
thanwahcommented, Dec 8, 2020

It appears that this bug is the cause of https://github.com/google/play-unity-plugins/issues/74. I’ll update to 1.4.0 to see if it fixes the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting a "Could not find a part of the path" exception?
Specify the exact folder and filename as how it is stored in the web server. use HttpContext.Current.Request.ApplicationPath or Server.MapPath to specify the ...
Read more >
Troubleshooting - Unity - Manual
If you are trying to install a new package from the registry and it is not working, it might be due to permission...
Read more >
Building applications with Maven - Quarkus
The project is generated in a directory named after the passed artifactId. If the directory already exists, the generation fails.
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
Troubleshooting AWS CLI errors - AWS Command Line Interface
If you receive an error that indicates that a command doesn't exist, ... The details in the output can help you to determine...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found