bundletool icon indicating copy to clipboard operation
bundletool copied to clipboard

NullPointerException of install-apks

Open zmbcen opened this issue 1 year ago • 0 comments

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

zmbcen avatar Aug 16 '24 10:08 zmbcen