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

FileSystemException while building apks #61

Closed
JudgerYang opened this issue Mar 27, 2019 · 8 comments
Closed

FileSystemException while building apks #61

JudgerYang opened this issue Mar 27, 2019 · 8 comments

Comments

@JudgerYang
Copy link

JudgerYang commented Mar 27, 2019

Describe the bug
When trying to build apks from aab, a FileSystemException is thrown

Bundletool version(s) affected
Version: [0.9.0]

Stacktrace
java.nio.file.FileSystemException: <tmp_dir>\1458615210662225422: failed to delete one or more files; see suppressed exceptions for details
at com.google.common.io.MoreFiles.throwDeleteFailed(MoreFiles.java:791)
at com.google.common.io.MoreFiles.deleteRecursively(MoreFiles.java:537)
at com.android.tools.build.bundletool.io.TempDirectory.close(TempDirectory.java:57)
at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:487)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:74)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46)
Suppressed: java.nio.file.DirectoryNotEmptyException: <tmp_dir>\1458615210662225422
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at com.google.common.io.MoreFiles.deleteRecursivelyInsecure(MoreFiles.java:665)
at com.google.common.io.MoreFiles.deleteRecursively(MoreFiles.java:526)
... 4 more

To Reproduce
bundletool build-apks --bundle=<aab_path> --output=<apks_path> --mode=universal

Expected behavior
bundletool terminates normally without exception

@plecesne
Copy link
Contributor

plecesne commented Mar 27, 2019

This looks like Windows, right?
Could you list what are the subdirectory and files remaining in the temp directory that cannot be deleted?

@JudgerYang
Copy link
Author

Yes, it's a Windows Server.
The only remaining file is universal.apk when this exception is thrown.
But it disappeared immediately after this issue is observed.

@jieli-carefree
Copy link

Describe the bug
When trying to build apks from aab, a FileSystemException is thrown

Bundletool version(s) affected
Version: [0.10.2]

Stacktrace
[BT:0.10.2] Error: java.nio.file.FileSystemException:<tmp_dir> \1133376475677183606: failed to delete one or more files; see suppressed exceptions for details
java.io.UncheckedIOException: java.nio.file.FileSystemException: C:\Users\18210\AppData\Local\Temp\1133376475677183606: failed to delete one or more files; see suppressed exceptions for details
at com.android.tools.build.bundletool.io.ConcurrencyUtils.waitFor(ConcurrencyUtils.java:55)
at com.android.tools.build.bundletool.io.ConcurrencyUtils.waitForAll(ConcurrencyUtils.java:42)
at java.util.function.Function.lambda$andThen$1(Function.java:88)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:503)
at com.android.tools.build.bundletool.io.ApkSerializerManager.serializeApks(ApkSerializerManager.java:180)
at com.android.tools.build.bundletool.io.ApkSerializerManager.populateApkSetBuilder(ApkSerializerManager.java:101)
at com.android.tools.build.bundletool.commands.BuildApksManager.executeWithZip(BuildApksManager.java:229)
at com.android.tools.build.bundletool.commands.BuildApksManager.execute(BuildApksManager.java:110)
at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:524)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:74)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46)

@jieli-carefree
Copy link

list what are the subdirectory and files remaining in the temp directory that cannot be deleted: Similar ZipBuilder - 7907700786045616036. Zip. TMP ,1133376475677183606 File contains "splits", "standalones" two empty folder

@plecesne
Copy link
Contributor

Thank you. I suspect this is an issue with the OS. We should possibly consider retrying the deletion after a small delay when it fails. I think Studio faced similar issues on Windows and implemented a retry strategy to work around it.

@Thaina
Copy link

Thaina commented Feb 11, 2020

bundletool-all-0.13.0.jar Still happen in windows. What is this?

@plecesne
Copy link
Contributor

Sorry for the delay. I've tried to implement a fix but I don't have a Windows machine to verify. This will be included in the next release.

@ymakhno
Copy link

ymakhno commented Mar 11, 2020

Should be fixed in 0.13.3.

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

5 participants