google / bundletool

Bundletool is a command-line tool to manipulate Android App Bundles
https://g.co/androidappbundle
Apache License 2.0
3.52k stars 385 forks source link

Error: Module 'base' is missing mandatory file 'manifest/AndroidManifest.xml'. #347

Closed SedgeWarbler closed 1 year ago

SedgeWarbler commented 1 year ago

Describe the bug [root@certain-fiber-10 test]# java -jar /usr/local/bin/bundletool.jar build-bundle --modules demo.zip --output base.aab [BT:1.15.4] Error: Module 'demo' is missing mandatory file 'manifest/AndroidManifest.xml'. com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: Module 'demo' is missing mandatory file 'manifest/AndroidManifest.xml'. at com.android.tools.build.bundletool.model.exceptions.UserExceptionBuilder.build(UserExceptionBuilder.java:58) at com.android.tools.build.bundletool.validation.MandatoryFilesPresenceValidator.checkModuleHasAndroidManifest(MandatoryFilesPresenceValidator.java:88) at com.android.tools.build.bundletool.validation.MandatoryFilesPresenceValidator.validateModuleZipFile(MandatoryFilesPresenceValidator.java:43) at com.android.tools.build.bundletool.validation.ValidatorRunner.lambda$validateModuleZipFile$2(ValidatorRunner.java:54) at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422) at com.android.tools.build.bundletool.validation.ValidatorRunner.validateModuleZipFile(ValidatorRunner.java:54) at com.android.tools.build.bundletool.validation.BundleModulesValidator.validate(BundleModulesValidator.java:72) at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:231) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:79) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:55

Bundletool version(s) affected Version: [1.15.4]

Stacktrace Copy all of the output of the command, including the stacktrace if visible.

To Reproduce Steps to reproduce the behavior. Include the full command being run as well as, if possible, artifacts the bug can be reproduced with.

Expected behavior A clear and concise description of what you expected to happen.

Known workaround If you have found a workaround, please specify what it is.

Environment: OS: [centos7]

Additional context 1695048861449

I have packaged the demo into a zip file I'm sure there's nothing wrong with the file directory

SedgeWarbler commented 1 year ago

my compression command jar cMf demo.zip manifest dex res root lib assets resources.pb

SedgeWarbler commented 1 year ago

solved! When packaging into base.zip, the file stored must be the root directory file.