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 failed: Failed to run on batchmode appbundle build #106

Closed
joonjoonjoon opened this issue May 5, 2021 · 4 comments
Closed

bundletool failed: Failed to run on batchmode appbundle build #106

joonjoonjoon opened this issue May 5, 2021 · 4 comments
Assignees

Comments

@joonjoonjoon
Copy link

Seeing this in the log of a batchmode build


bundletool failed: Failed to run '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -jar "/Users/joon/git/inua/Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Tools/bundletool-all.jar" build-bundle --overwrite --config="/var/folders/8c/1lkfpptx58vfghggl5t8f48c0000gn/T/BundleConfig.json" --modules=/var/folders/8c/1lkfpptx58vfghggl5t8f48c0000gn/T/play-unity-build/jor9ixr0.2dg/scenes/scenes.zip,/var/folders/8c/1lkfpptx58vfghggl5t8f48c0000gn/T/play-unity-build/jor9ixr0.2dg/base/base.zip --output="inua.aab" --metadata-file=com.android.tools.build.libraries/dependencies.pb:/var/folders/8c/1lkfpptx58vfghggl5t8f48c0000gn/T/play-unity-build/jor9ixr0.2dg/base/source/BUNDLE-METADATA/com.android.tools.build.libraries/dependencies.pb'
stdout:

stderr:
[BT:1.5.0] Error: null
java.lang.NullPointerException
	at java.nio.file.Files.provider(Files.java:97)
	at java.nio.file.Files.notExists(Files.java:2434)
	at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:260)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:71)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:47)

I am using this command to build the app bundle

public static void Build()
   {
       var assetPackConfig = new AssetPackConfig();
       assetPackConfig.AddAssetBundle(AssetBundleDirectory + "scenes", AssetPackDeliveryMode.FastFollow);
      
       //CreateAssetPackConfig();
       var buildPlayerOptions = AndroidBuildHelper.CreateBuildPlayerOptions(AabFilePath);

       if (!Bundletool.BuildBundle(buildPlayerOptions, assetPackConfig))
       {
           throw new Exception("Asset Delivery Demo build failed");
       }
   }
@joonjoonjoon
Copy link
Author

I downgraded to release 1.3.0 from 1.4.0 and the bug no longer shows up, with otherwise identical code.

I google translated one of the google results when trying to find out what the error means and they suggested the downgrade: https://baba-s.hatenablog.com/entry/2021/04/27/150000

@thanwah thanwah self-assigned this May 6, 2021
@thanwah
Copy link
Contributor

thanwah commented May 6, 2021

Thanks @joonjoonjoon for filing this issue and for describing your workaround.

I believe this is caused by google/bundletool#214, and I've reached out to the bundletool owner to find out when a fix will be released.

@joonjoonjoon
Copy link
Author

this is likely the same issue as #102

thanwah pushed a commit that referenced this issue May 18, 2021
Fixed issue #106: `bundletool build-bundle` crashed when output file was specified without a parent directory

PiperOrigin-RevId: 374470058
@thanwah
Copy link
Contributor

thanwah commented May 18, 2021

Now fixed at HEAD by updating bundletool to 1.6.1.

@thanwah thanwah closed this as completed May 18, 2021
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

2 participants