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

Bundletool cannot package with "wrap.sh" #149

Closed
ganadist opened this issue Mar 16, 2020 · 7 comments
Closed

Bundletool cannot package with "wrap.sh" #149

ganadist opened this issue Mar 16, 2020 · 7 comments

Comments

@ganadist
Copy link

Describe the bug
I tried to add wrap.sh as described on https://developer.android.com/ndk/guides/wrap-script#packaging_wrapsh
But bundletool fails when wrap.sh is added.

Bundletool version(s) affected
Version: 0.13.3

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

Caused by: com.android.tools.build.bundletool.model.exceptions.BundleFileTypesException$FileUsesReservedNameException: File 'root/lib/arm64-v8a/wrap.sh' uses reserved file or directory name 'lib'.
	at com.android.tools.build.bundletool.validation.BundleFilesValidator.validateModuleFile(BundleFilesValidator.java:116)
	at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleModulesUsingSubValidator(ValidatorRunner.java:81)
	at com.android.tools.build.bundletool.validation.ValidatorRunner.lambda$validateBundleModules$4(ValidatorRunner.java:64)
	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:405)
	at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleModules(ValidatorRunner.java:63)
	at com.android.tools.build.bundletool.validation.BundleModulesValidator.validate(BundleModulesValidator.java:85)
	at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:208)

To Reproduce
Source code is https://github.com/ganadist/VersionCodeDemo/tree/wrapsh_packaging.
Note: branch name is wrapsh_packaging

$ git clone https://github.com/ganadist/VersionCodeDemo -b wrapsh_packaging
$ ./gradlew :app:assembleDevelop
$ ./gradlew :app:bundleDevelop

There is no problem when perform :app:assembleDebug task, but when perform :app:bundleDevelop task, error will be raised.

Expected behavior
AppBundle created without any problem.

Known workaround

Environment:
OS: Archlinux
Android Gradle Plugin: 3.6.1

Additional context
AGP 3.6.1 contains bundletool 0.10.3, but, sample project is using bundletool 0.13.3

@ymakhno
Copy link

ymakhno commented Apr 23, 2020

Fixed in 0.14.0.

@zhaoshe
Copy link

zhaoshe commented Mar 15, 2021

@ymakhno I found this solution not work
image

@ymakhno
Copy link

ymakhno commented Mar 16, 2021

In .aab file wrap.sh must be placed under <module>/lib/<platform> directory. root/lib is incorrect location.

@zhaoshe
Copy link

zhaoshe commented Mar 18, 2021

In .aab file wrap.sh must be placed under <module>/lib/<platform> directory. root/lib is incorrect location.

It is not the truth when I followed the instruction in this page.
And I created a demo project to show it.

Feel free to clone my project https://github.com/zhaoshe/BundleToolIssue149Demo and execute ./gradlew :app:bundleDebug.
And you will get the same output:

image

@ymakhno
Copy link

ymakhno commented Mar 18, 2021

It is Android Gradle Plugin issue in this case because wrap.sh should be placed in <module>/lib/<platform>. Please report to them http://issuetracker.google.com/issues?q=componentid:192709.

@troy-lamerton
Copy link

@zhaoshe did you find a workaround? I might make a pull request to fix this if there's no workaround

@zhaoshe
Copy link

zhaoshe commented May 8, 2021

@zhaoshe did you find a workaround? I might make a pull request to fix this if there's no workaround

I just forked this project, made some change and packaged a bundle.jar.

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

4 participants