Comments (4)
Looks like this worked for us! Thank you :)
from rules_android_ndk.
Ankit, if useful, we're currently using the following platform_mappings to get things working with Android until platforms support arrives:
//platform_mappings
flags:
# Android
# Mostly, native code is compiled after the android_binary rule has run a transition to compile for that platform.
# We just detect the transition, which sets "Android configuration distinguisher", and then translate the CPU it set.
--Android configuration distinguisher=android
--cpu=arm64-v8a
//Bazel/Platforms:_android-arm64
--Android configuration distinguisher=android
--cpu=armeabi-v7a
//Bazel/Platforms:_android-armv7
--Android configuration distinguisher=android
--cpu=x86_64
//Bazel/Platforms:_android-x86_64
--Android configuration distinguisher=android
--cpu=x86
//Bazel/Platforms:_android-x86_32
//Bazel/Platforms/BUILD
# Grind through the full cartesian product of OS<>CPU, so we have the combinations available for easy use.
# config_setting()s allows easy use in select(). (Annoyingly, platforms can't be used in select(). See https://github.com/bazelbuild/bazel/issues/15575)
# List comprehension works around the lack of for loops at the top level in Starlark.
# Floated making these an official part of platforms here: https://github.com/bazelbuild/platforms/issues/36
[(
config_setting(
name = os + "-" + arch,
visibility = ["//visibility:public"],
constraint_values = [
"@platforms//os:" + os,
"@platforms//cpu:" + arch,
]
),
platform( # Please don't use these outside of //platform_mappings. See that file for more details on the implementation that configures the built-in platform flags.
name = "_" + os + "-" + arch,
constraint_values = [
"@platforms//os:" + os,
"@platforms//cpu:" + arch,
]
)
)
for os in ["android", "ios", "macos"] for arch in ["arm64", "armv7", "x86_64", "x86_32"]]
# ^ If you're getting errors around aarch64 not matching arm64, despite aarch64 being a deprecated alias for arm64, some dependency has dragged in an ancient version of platforms. See https://github.com/bazelbuild/bazel/issues/14605
from rules_android_ndk.
Yay! Delighted to hear it.
from rules_android_ndk.
Hey @cpsauer we migrated to use android platforms with the latest release (since according to https://blog.bazel.build/2023/11/15/android-platforms.html it is supported) and this issue seems to still show up. I'm curious as to why it is not working. Specifically we are still seeing aar_import
fail. Will we still need to wait for rules_android
to be complete in order to enable it?
from rules_android_ndk.
Related Issues (20)
- Cross compilation issues HOT 9
- Support cc toolchain resolution HOT 1
- Error when using unsupported NDK directory HOT 1
- Run app in an emulator in presubmit tests
- Does this project support bazel 5.2.0? HOT 19
- Remove "ndk/"-prefixed include path compatibility workarounds HOT 2
- Missing "default_crosstool" or "toolchain-libcpp" causing some Google dependencies fail to build for Android.
- How to correctly link to liblog? HOT 3
- NDK 26 support HOT 10
- Building cc_binary with rules unable to find cc_toolchain_suite
- Adding downloading of NDK inside Bazel HOT 5
- ERROR: --nouse_workers_with_dexbuilder :: Unrecognized option: --nouse_workers_with_dexbuilder with Bazel@HEAD HOT 1
- NDK headers HOT 5
- Is Android NDK r25c support? HOT 3
- `std::cout` isn't initialized before any user-defined static initialization HOT 2
- Proposal: use a path relative to `ANDROID_HOME` like in Android Gradle Plugins
- Building with `--android_platforms=//:arm64` returns error. HOT 1
- [Bazel CI] Unable to fetch rules_android_maven: "empty string" HOT 1
- [Bazel CI] Error: Both --enable_bzlmod and --enable_workspace are disabled
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 rules_android_ndk.