Build failure with bazel, can't find `build-tools/33.0.0-rc4/lib/dx.jar`
See original GitHub issueI’m trying to run bazel build testdpc
but it fails.
First it wants SDK 33
, AFAICT we only have Tiramisu
publicly so far. I worked around that by symlinking Tiramisu
to 33
in my SDK install.
After that, it fails with:
INFO: Analyzed target //:testdpc (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/user/.cache/bazel/_bazel_user/1453d0cfa808044da9e372be74772bd0/external/androidsdk/BUILD.bazel:13:25: Extracting interface @androidsdk//:dx_jar_import failed: missing input file 'external/androidsdk/build-tools/33.0.0-rc4/lib/dx.jar', owner: '@androidsdk//:build-tools/33.0.0-rc4/lib/dx.jar'
ERROR: /home/user/.cache/bazel/_bazel_user/1453d0cfa808044da9e372be74772bd0/external/androidsdk/BUILD.bazel:13:25: Extracting interface @androidsdk//:dx_jar_import failed: 1 input file(s) do not exist
Target //:testdpc failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/user/.cache/bazel/_bazel_user/1453d0cfa808044da9e372be74772bd0/external/androidsdk/BUILD.bazel:13:25 Extracting interface @androidsdk//:dx_jar_import failed: 1 input file(s) do not exist
INFO: Elapsed time: 0.412s, Critical Path: 0.32s
INFO: 74 processes: 41 internal, 33 linux-sandbox.
FAILED: Build did NOT complete successfully
If I check the folder, it has a d8.jar
but not dx.jar
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Compiling Bazel from Source
See Installing Bazel. (Or you can build from scratch (bootstrap).) Troubleshooting: If you cannot run Bazel by typing bazel in a terminal:.
Read more >Gerrit build with bazel: maven2 jar sh1 not match
My build environment is Ubuntu 14.04.6, Python v3.4.3, java 8, nodejs v8.9.3, apache/2.4.7, Maven 3.0.5 I use "bazel build ...
Read more >Error building ONOS master with bazel - Google Groups
Cannot change ownership to uid 501, gid 50: Invalid argument ... Use --verbose_failures to see the command lines of failed build steps.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Check the command to build "This sample uses the Bazel build system. To build this project, use the “bazel build –noincremental_dexing”
IF you still have an issue on build …
I had the same issue on my desktops, and recognized it might be an issue on Bazel build itself. Here’re the solutions which I googled
OR
$ bazel build testdpc --define=android_dexmerger_tool=d8_dexmerger --define=android_incremental_dexing_tool=d8_dexbuilder --nouse_workers_with_dexbuilder
I’m not fully confident with this change, but got a successful build after adding this line on BUILD file (the number of ‘dex_shard’ was needed to be increased)
$ bazel build testdpc --define=android_dexmerger_tool=d8_dexmerger --define=android_incremental_dexing_tool=d8_dexbuilder --nouse_workers_with_dexbuilder
INFO: Analyzed target //:testdpc (1 packages loaded, 277 targets configured). INFO: Found 1 target… Target //:testdpc up-to-date: bazel-bin/testdpc_deploy.jar bazel-bin/testdpc_unsigned.apk bazel-bin/testdpc.apk INFO: Elapsed time: 7.756s, Critical Path: 7.50s INFO: 13 processes: 4 internal, 8 linux-sandbox, 1 worker. INFO: Build completed successfully, 13 total actions
Thanks for resolving that! Let’s leave this issue open in case other people have this issue - and we’ll try to figure out the proper solution which doesn’t involve copying files around.
I’m new to using Bazel so don’t know the best practices - we’re using it to make the build system as consistent as possible with the one used internally for TestDPC development.
Re: the version code not being set - we’ll have a fix for that soon.