Code Monkey home page Code Monkey logo

Comments (4)

ahumesky avatar ahumesky commented on August 10, 2024

Is this using rules_jvm_external, or is it from hand-written BUILD/WORKSPACE files?
In general if a java rule depends on an android rule, the java rule won't know anything about the android-specific providers (e.g. for android resources) and take only the java ones (it's probably an accident that jvm_import can depend on aar_import at all)

from rules_android.

xinzhengzhang avatar xinzhengzhang commented on August 10, 2024

Is this using rules_jvm_external, or is it from hand-written BUILD/WORKSPACE files? In general if a java rule depends on an android rule, the java rule won't know anything about the android-specific providers (e.g. for android resources) and take only the java ones (it's probably an accident that jvm_import can depend on aar_import at all)

I am using rules_jvm_external (5.3). We can reproduce it with

module(
    name = "test_project",
    version = "0.0.1",
)

bazel_dep(name = "rules_jvm_external", version = "5.3")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    name = "maven_deps",
    artifacts = [
        "androidx.compose.ui:ui:1.5.4",
        "androidx.lifecycle:lifecycle-runtime:2.6.1"
    ],
    version_conflict_policy = "pinned",
    repositories = [
        "https://maven-central.storage.googleapis.com/repos/central/data/",
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)
use_repo(maven, "maven_deps")

We can see that androidx_compose_ui_ui(jvm_import) dep on aar_import target androidx_compose_ui_ui_android in

`bazel info output_base`/external/rules_jvm_external\~5.3\~maven\~maven_deps/BUILD

jvm_import(
	name = "androidx_compose_ui_ui",
	jars = ["v1/https/maven.google.com/androidx/compose/ui/ui/1.5.4/ui-1.5.4.jar"],
	srcjar = "v1/https/maven.google.com/androidx/compose/ui/ui/1.5.4/ui-1.5.4-sources.jar",
	deps = [
		":androidx_compose_runtime_runtime_saveable",
		":androidx_compose_ui_ui_android",
		":androidx_compose_ui_ui_geometry",
		":androidx_compose_ui_ui_graphics",
		":androidx_compose_ui_ui_text",
		":androidx_compose_ui_ui_unit",
	],
	tags = [
		"maven_coordinates=androidx.compose.ui:ui:1.5.4",
		"maven_url=https://maven-central.storage.googleapis.com/repos/central/data/androidx/compose/ui/ui/1.5.4/ui-1.5.4.jar",
	],
	visibility = ["//visibility:public"],
)

aar_import(
	name = "androidx_compose_ui_ui_android",
	aar = "v1/https/maven.google.com/androidx/compose/ui/ui-android/1.5.4/ui-android-1.5.4.aar",
	srcjar = "v1/https/maven.google.com/androidx/compose/ui/ui-android/1.5.4/ui-android-1.5.4-sources.jar",
	deps = [
		":androidx_activity_activity_ktx",
		":androidx_annotation_annotation",
		":androidx_autofill_autofill",
		":androidx_collection_collection",
		":androidx_compose_runtime_runtime_android",
		":androidx_compose_runtime_runtime_saveable_android",
		":androidx_compose_ui_ui_geometry",
		":androidx_compose_ui_ui_graphics",
		":androidx_compose_ui_ui_text",
		":androidx_compose_ui_ui_unit",
		":androidx_compose_ui_ui_util",
		":androidx_core_core",
		":androidx_customview_customview_poolingcontainer",
		":androidx_emoji2_emoji2",
		":androidx_lifecycle_lifecycle_runtime",
		":androidx_lifecycle_lifecycle_viewmodel",
		":androidx_profileinstaller_profileinstaller",
		":androidx_savedstate_savedstate_ktx",
		":org_jetbrains_kotlin_kotlin_stdlib",
		":org_jetbrains_kotlin_kotlin_stdlib_common",
		":org_jetbrains_kotlinx_kotlinx_coroutines_android",
		":org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm",
	],
	tags = [
		"maven_coordinates=androidx.compose.ui:ui-android:aar:1.5.4",
		"maven_url=https://maven-central.storage.googleapis.com/repos/central/data/androidx/compose/ui/ui-android/1.5.4/ui-android-1.5.4.aar",
	],
	visibility = ["//visibility:public"],
)

from rules_android.

ahumesky avatar ahumesky commented on August 10, 2024

Version 1.6.0 was released recently, and it's an AAR: https://mvnrepository.com/artifact/androidx.compose.ui/ui/1.6.0

Would you be able to update to this version? That should avoid this problem

from rules_android.

xinzhengzhang avatar xinzhengzhang commented on August 10, 2024

I have updated to version 1.6.0 and the problem seems to be resolved. I appreciate your help.

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.