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

NoSuchFileException when paths contain a tilde sign (~) #12

Closed
baole opened this issue May 24, 2018 · 3 comments
Closed

NoSuchFileException when paths contain a tilde sign (~) #12

baole opened this issue May 24, 2018 · 3 comments

Comments

@baole
Copy link

baole commented May 24, 2018

Describe the bug
NoSuchFileException thrown when runs build-apks command

Bundletool version(s) affected
Version: [e.g. 0.4.1]

Stacktrace

macbook-pro:bin$ java -jar bundletool-all-0.4.1.jar build-apks  --bundle=../../app/build/outputs/bundle/playRelease/bundle.aab --output=~/Downloads/tandem.apks
WARNING: The APKs won't be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information.
[BT:0.4.1] Error: Error while writing the APK Set archive to '~/Downloads/tandem.apks'.
com.android.tools.build.bundletool.exceptions.CommandExecutionException: Error while writing the APK Set archive to '~/Downloads/tandem.apks'.
        at com.android.tools.build.bundletool.exceptions.CommandExecutionException$Builder.build(CommandExecutionException.java:81)
        at com.android.tools.build.bundletool.io.ApkSetBuilderFactory$ApkSetArchiveBuilder.writeTo(ApkSetBuilderFactory.java:124)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.executeWithTempDir(BuildApksCommand.java:310)
        at com.android.tools.build.bundletool.io.TempFiles.withTempDirectoryReturning(TempFiles.java:51)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:237)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:72)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44)
Caused by: java.nio.file.NoSuchFileException: /var/folders/3j/8k6z66l50dq_d1sjfxl8cphh0000gn/T/ZipBuilder-3573363741609217405.zip.tmp -> ~/Downloads/tandem.apks
        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:105)
        at com.android.tools.build.bundletool.io.ApkSetBuilderFactory$ApkSetArchiveBuilder.writeTo(ApkSetBuilderFactory.java:119)
        ... 5 more

To Reproduce

Expected behavior
Generated .apks file

Known workaround

Environment:
Mac OS

Additional context

@plecesne
Copy link
Contributor

You'll need to replace the "~" with the full path to your home directory. We'll try to fix this in a future release.

@baole
Copy link
Author

baole commented May 28, 2018

Thanks @plecesne. It works

@plecesne plecesne changed the title NoSuchFileException when running build-apks command NoSuchFileException when paths contain a tilde sign (~) Jun 5, 2018
@tdobek
Copy link
Contributor

tdobek commented Jun 6, 2018

This should be fixed now in 0.4.2. Closing.

@tdobek tdobek closed this as completed Jun 6, 2018
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

3 participants