google / google/bundletool

NullPointerException of install-apks

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

Description

I'm having issues installing apks with bundletool, where I'm getting a NullPointerException when the file is known to exist.

```
zhoumubaicen@zmbcendeMBP zmbcen % java -jar bundletool-all-1.17.1.jar install-apks --apks=/Users/zhoumubaicen/Desktop/xiaoduAccess/deviceAccess/QingHe-xps06e/google_file_1.4237.652465286.1-release.apks

[BT:1.17.1] Error: null
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:903)
at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:238)
at com.google.common.io.ByteSource.read(ByteSource.java:300)
at com.android.tools.build.bundletool.model.utils.ResultUtils.readTableOfContentFromApksArchive(ResultUtils.java:70)
at com.android.tools.build.bundletool.model.utils.ResultUtils.readTableOfContents(ResultUtils.java:55)
at com.android.tools.build.bundletool.commands.InstallApksCommand.readBuildApksResult(InstallApksCommand.java:388)
at com.android.tools.build.bundletool.commands.InstallApksCommand.execute(InstallApksCommand.java:195)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:117)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:55)
```
I tried using java11, 17 and 22, and the above error occurred。

On the other hand, I used a third-party apks installer to install the apks, and the apks were installed correctly, which shows that there is no problem with my apks. But this problem occurred when I used bundletool, which is also what puzzled me.

The apks is "Files By Google [v1.4237.652465286.1-release"]
https://play.google.com/store/apps/details?id=com.google.android.apps.nbu.files&hl=zh

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.