Code Monkey home page Code Monkey logo

Comments (7)

katre avatar katre commented on August 10, 2024

Looks like the issue is RourceDependencies.fromRuleDeps, which is looking for the AndroidResourceInfo.PROVIDER provider. This is present with the master branch, but not with the pre-alpha, which I assume is due to starlarkifying android_library.

from rules_android.

katre avatar katre commented on August 10, 2024

Yes, looks like the native android_library calls AndroidResources.from, which collects the AndroidResourceInfo providers, but the version in pre-alpha does not.

from rules_android.

katre avatar katre commented on August 10, 2024

Okay, finally figured out the issue.

The pre-alpha version of resource collection (as implemented in rules/resources.bzl only checks for the existence of StarlarkAndroidResourcesInfo, not the native AndroidResourcesInfo.

The Starlark version of aar_import creates this provider, as expected.

However, the code in examples/android/ndk depends on appcompat via maven_install from rules_jvm_external, which creates an aar_import target using the native rules, which uses the native provider.

Either the pre-alpha branch needs to check for both possible providers, or rules_jvm_export needs to use the same pre-alpha version of aar_import, or rules_jvm_export isn't compatible with rules_android pre-alpha.

from rules_android.

katre avatar katre commented on August 10, 2024

Looks like rules_jvm_external has support for this, possibly.

from rules_android.

katre avatar katre commented on August 10, 2024

But even using the starlark aar_import, the target @maven//:androidx_appcompat_appcompat doesn't have the StarlarkAndroidResourcesInfo provider.

Using native aar_import to list provider names:

$ /tmp/blazes/bazel cquery --output=starlark --starlark:expr='providers(target).keys()' @maven//:androidx_appcompat_appcompat_resources
[
  "InstrumentedFilesInfo",
  "AndroidResourcesInfo",
  "AndroidManifestInfo",
  "AndroidAssetsInfo",
  "DataBindingV2Info",
  "ProguardSpecProvider",
  "AndroidNativeLibsInfo",
  "JavaInfo",
  "FileProvider",
  "FilesToRunProvider",
  "OutputGroupInfo",
]

Using Starlark aar_import to list provider names:

$ /tmp/blazes/bazel cquery --output=starlark --starlark:expr='providers(target).keys()' @maven//:androidx_appcompat_appcompat_resources
[
  "AndroidLibraryResourceClassJarProvider",
  "JavaInfo",
  "AndroidNativeLibsInfo",
  "ProguardSpecProvider",
  "AndroidIdeInfo",
  "FileProvider",
  "FilesToRunProvider",
  "OutputGroupInfo",
]

from rules_android.

katre avatar katre commented on August 10, 2024

Retitled issue to clarify the root cause.

from rules_android.

ted-xie avatar ted-xie commented on August 10, 2024

This should be fixed if/when we merge https://github.com/bazelbuild/rules_android/pull/52/files#diff-e2839f4bd7500de02db70226d1fb363bc1bcd62e2ac7046594dafc3e7040fa09.

from rules_android.

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.