Giter VIP home page Giter VIP logo

Comments (4)

ankit-agarwal1999 avatar ankit-agarwal1999 commented on September 24, 2024 1

Looks like this worked for us! Thank you :)

from rules_android_ndk.

cpsauer avatar cpsauer commented on September 24, 2024

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.

cpsauer avatar cpsauer commented on September 24, 2024

Yay! Delighted to hear it.

from rules_android_ndk.

ankit-agarwal1999 avatar ankit-agarwal1999 commented on September 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.