Comments (7)
I'll take a look today
from examples.
@katre Is #398 related to this?
from examples.
There are two problems, lack of a CC toolchain and lack of a runtime Java toolchain
- There's no
android_ndk_repository
, which means there are no Android CC toolchains available. Possibly this worked in the past but currently every Android project needs CC toolchains - The version of Android rules in use is v0.1.1, which is from 2018, and so is slightly out of date with Bazel at head.
I can create a PR to fix these issues.
I'm not sure when the requirement for a runtime Java toolchain was added, and I'm not sure where that should even come from. (pinging @ahumesky for advice).
from examples.
v0.1.1 of rules_android is just thin wrappers around the native android rules, so it's possible that something elsewhere within bazel changed to require this --
This is where we get the java toolchains in the starlark rules:
https://github.com/bazelbuild/rules_android/blob/5f6cc061249f8ea750f221da1ee0916cba61563f/MODULE.bazel#L8-L11
from examples.
Okay, debugged a bit further: rules_java adds runtime toolchains for various processors, including aarch64
, but not for the Android OS constraint, so those aren't used. (These are created from the remote JDKs defined in rules_java/MODULE.bazel, where the target constraints are determined based on the actual name. There are no JDKs loaded for "android_aarch64", so none exist).
The JDK toolchain (not runtime) is fine, because it doesn't define any target constraints (cpu or os) (see https://github.com/bazelbuild/rules_java/blob/9cd25f0f7edc5184c4f1a10c4772ac4127f7322e/toolchains/default_java_toolchain.bzl#L181).
@ahumesky: Does the Android SDK contain a JDK for the different Android cpu flavors (in which case we just need to add the relevant toolchain
configs), or do we need to download and configure a new one?
from examples.
Does the Android SDK contain a JDK for the different Android cpu flavors
I'm not sure that's what we want? There aren't JDKs for Android cpu flavors. I wonder if that what we want here is to be able to run things like robolectric tests, which exercise code built targeting a particular Android flavour on a JVM.
The approach we take for that in google3 is:
toolchain(
name = "jdk-runtime-fake-android",
target_compatible_with = [
"//third_party/bazel_platforms/os:android",
],
toolchain = ... # A JDK for the platform that the robolectric test executes on, e.g. linux k8
toolchain_type = ":runtime_toolchain_type",
)
from examples.
That's a great question: all I know is "bazel thinks it wants a runtime JDK that targets android_aarch64", I haven't dug into why it wants that.
from examples.
Related Issues (20)
- Next.js example uses invalid path to next binary for dev and start targets HOT 1
- frontend/react - Running js_run_devserver on windows not starting. HOT 8
- Error no such attribute 'temporary_directory' in 'xcodeproj_runner' rule with Bazel@HEAD HOT 2
- Dependency Dashboard
- Error android_jar requested an android sdk via toolchain resolution but hasn't set an appropriate --android_platforms value with Bazel@Head HOT 1
- ewdk
- example frontend/next.js doesn't work on windows HOT 8
- fatal error: jni.h: No such file or directory with Bazel@HEAD HOT 2
- [FR] demonstrate Next.js example with output: "standalone" HOT 4
- cpp-tutorial can't find external linux toolchain HOT 4
- cpp-tutorial doesn't work on AArch64 systems
- fatal error: 'jni.h' file not found with Bazel@HEAD HOT 1
- cpp-tutorial/stage1 bazel build looks for compiler in wrong /tmp path HOT 1
- frontend (basics_macos_latest) is flaky HOT 2
- ERROR: Failed to load Starlark extension '@@maven//:compat.bzl' HOT 1
- [Bazel CI] aspect_rules_js no such file error or directory with Bazel@HEAD in CI HOT 13
- [Bazel CI] Error name 'aar_import' is not defined with Bazel@HEAD HOT 1
- [Bazel CI] Rules Java error: Cannot load '@bazel_skylib~//lib:modules.bzl'
- [Bazel CI] Analysis of target '//:main' failed due to missing dependency '@@bazel_skylib~//lib:modules.bzl'
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 examples.