Comments (3)
It seems that you are encountering an error while running the Bazel build command for the helloworld target in the com/google/j2cl/samples/helloworld package. The error message suggests that there are unused native files causing the build failure.
Here are a few suggestions to troubleshoot the issue:
Check the build configuration: Ensure that you have the correct dependencies and build settings configured for the J2CL project. Make sure that all required dependencies are correctly specified in the BUILD files and that your Bazel workspace is set up properly.
Verify the J2CL version: Ensure that you are using a compatible version of the J2CL transpiler. Check if there are any specific version requirements or compatibility issues mentioned in the project's documentation or release notes. You might need to update or adjust the J2CL version accordingly.
Clean and rebuild: Try cleaning the Bazel build cache and performing a clean build. Run bazel clean --expunge to remove any cached build artifacts and then try building again using the bazel build command.
Check for unused native files: The error message indicates that there are unused native files causing the build failure. Review the J2CL project's configuration and make sure that the native files are correctly included or excluded as needed. You might need to update the build configuration to address this issue.
Enable verbose output: If the issue persists, you can use the --verbose_failures flag with the bazel build command to get more detailed information about the failed build steps. This can help you identify the specific cause of the failure.
If none of these suggestions resolve the issue, I recommend consulting the J2CL project's documentation, issue tracker, or community forums for further assistance. They may have specific recommendations or workarounds for the problem you are facing.
from j2cl.
Thank you for your quick reply. But to be honest. I expect that the master contains all the appropriate dependencies. Because that is the getting started part.
I did the baszel clean and also added --verbose_failures, but the result is the same.
ERROR: C:/users/fujitsu/_bazel_fujitsu/7zwbdliw/external/com_google_j2cl/jre/java/BUILD:167:13: Transpiling to JavaScript @com_google_j2cl//jre/java:jre failed: (Exit 1): BazelJ2clBuilder.exe failed: error executing command
cd /d C:/users/fujitsu/_bazel_fujitsu/7zwbdliw/execroot/com_google_j2cl_samples_helloworld
SET LANG=en_US.UTF-8
bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\com_google_j2cl\transpiler\java\com\google\j2cl\transpiler\BazelJ2clBuilder.exe @bazel-out/x64_windows-fastbuild/bin/external/com_google_j2cl/jre/java/jre.js-0.params
- Configuration: 2877ba0b561476092d5c4022bf856304f1e5dc1625249de071df1a06df98703b
- Execution platform: @local_config_platform//:host
Error: Unused native file 'java/lang/Class.native.js'.
Error: Unused native file 'java/lang/IntegralToString.native.js'.
Error: Unused native file 'javaemul/internal/Casts.native.js'.
Error: Unused native file 'javaemul/internal/ConsoleLogger.native.js'.
Error: Unused native file 'javaemul/internal/HashCodes.native.js'.
Error: Unused native file 'javaemul/internal/JsUtils.native.js'.
Error: Unused native file 'javaemul/internal/Objects.native.js'.
Error: Unused native file 'javaemul/internal/ThrowableUtils.native.js'.
Error: Unused native file 'javaemul/internal/ValueType.native.js'.
9 error(s), 0 warning(s).
Target //src/main/java/com/google/j2cl/samples/helloworld:helloworld failed to build
INFO: Elapsed time: 492.668s, Critical Path: 123.29s
INFO: 551 processes: 42 internal, 455 local, 54 worker.
FAILED: Build did NOT complete successfully
from j2cl.
Works for me on Linux. Could it be because you're using Windows, and outside WSL? (see https://github.com/google/j2cl#caveat-emptor)
(note: I do have the same warnings about @local_jdk//:jar
and the Kotlin toUpperCase
→uppercase
et al., but not the libast ones about annotation processing)
from j2cl.
Related Issues (20)
- Wasm sample broken HOT 2
- package listing?
- io_bazel_rules_kotlin_configured HOT 4
- How to fix the error: unused native file on Windows 11? HOT 1
- Ready to work on download file
- Wasm sample broken v2 HOT 2
- JUnit test example for wasm HOT 5
- [WASM] HashMap.computeIfAbsent doesn't work as expected HOT 1
- Can't run j2cl on Bazel 6 HOT 6
- Bazel: accidental impossible target HOT 2
- goog.reflect.sinkValue and deadcode elimination
- How to use it in vite +vue3
- Automate release/tag of the repo on green builds
- predicate is not usable by but exposed to JavaScript. HOT 3
- Support `rules_jvm_external` or `j2cl_maven_import_external` private registry HOT 1
- JRE emulation misses java.io.Externalizable
- Add dependabot to keep GitHub Actions up-to-date
- public methods are too eagerly optimized away; need ability to declare "@export" annotation HOT 9
- "Native JsType method '...' should be native, abstract or JsOverlay." error prevents default implementation for vanilla Java HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from j2cl.