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

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

Closed
tutipeti opened this issue Nov 13, 2020 · 5 comments
Closed

Comments

@tutipeti
Copy link
Contributor

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.

@plecesne
Copy link
Contributor

Indeed!
We're accepting contributions by the way :)

@tutipeti
Copy link
Contributor Author

@plecesne opened a PR ;)

@ymakhno
Copy link

ymakhno commented Nov 18, 2020

Thank you for the contribution!

@ymakhno
Copy link

ymakhno commented Nov 20, 2020

Released in 1.4.0.

@thanwah
Copy link

thanwah commented Dec 8, 2020

It appears that this bug is the cause of google/play-unity-plugins#74. I'll update to 1.4.0 to see if it fixes the issue.

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

4 participants