Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style attribute not found (kt_db_android_library) #1

Closed
ajanuar opened this issue Jul 28, 2021 · 2 comments
Closed

style attribute not found (kt_db_android_library) #1

ajanuar opened this issue Jul 28, 2021 · 2 comments
Labels
needs info Requires more information to proceed

Comments

@ajanuar
Copy link
Contributor

ajanuar commented Jul 28, 2021

Hello guys, I am using Bazel rule kt_db_android_library and found broken compilation. Any idea how to fix this?

load("@grab_bazel_common//tools/build_config:build_config.bzl", "build_config")
load("@grab_bazel_common//tools/databinding:databinding.bzl", "kt_db_android_library")

build_config(
    name = "arjuna-build-config",
    package_name = "com.albertjanuar.android.arjuna",
    strings = {
        "VERSION_CODE": "250",
        "VERSION_NAME": "3.37.0",
    },
)

kt_db_android_library(
    name = "arjuna",
    srcs = glob([
        "src/main/java/**/*.kt",
        "src/main/java/**/*.java"
    ]),
    manifest = "src/main/AndroidManifest.xml",
    custom_package = "com.albertjanuar.android.arjuna",
    resource_files = glob([
        "src/main/res/**",
    ]),
    visibility = [
        "//visibility:public", 
    ],
    deps = [
        ":arjuna-build-config",
        "//bazel:parceler",
        "//icons:icons",
        "@maven//:androidx_appcompat_appcompat", 
        "@maven//:androidx_recyclerview_recyclerview",
        "@maven//:com_google_android_material_material",
        "@maven//:org_apache_commons_commons_lang3",
    ]
)

output:

Output:
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:46: error: style attribute 'attr/accentDark (aka com.albertjanuar.android.arjuna:attr/accentDark)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:47: error: style attribute 'attr/accentLight (aka com.albertjanuar.android.arjuna:attr/accentLight)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:44: error: style attribute 'attr/accentPrimary (aka com.albertjanuar.android.arjuna:attr/accentPrimary)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:76: error: style attribute 'attr/accentPrimaryTranslucent (aka com.albertjanuar.android.arjuna:attr/accentPrimaryTranslucent)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:45: error: style attribute 'attr/accentSecondary (aka com.albertjanuar.android.arjuna:attr/accentSecondary)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:71: error: style attribute 'attr/borderDivide (aka com.albertjanuar.android.arjuna:attr/borderDivide)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:70: error: style attribute 'attr/borderSubtle (aka com.albertjanuar.android.arjuna:attr/borderSubtle)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:37: error: style attribute 'attr/brand (aka com.albertjanuar.android.arjuna:attr/brand)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:56: error: style attribute 'attr/darkNeutral (aka com.albertjanuar.android.arjuna:attr/darkNeutral)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:80: error: style attribute 'attr/darkNeutralTranslucent (aka com.albertjanuar.android.arjuna:attr/darkNeutralTranslucent)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:54: error: style attribute 'attr/darkPrimary (aka com.albertjanuar.android.arjuna:attr/darkPrimary)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:57: error: style attribute 'attr/darkSecondary (aka com.albertjanuar.android.arjuna:attr/darkSecondary)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:55: error: style attribute 'attr/darkStain (aka com.albertjanuar.android.arjuna:attr/darkStain)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:51: error: style attribute 'attr/lightNeutral (aka com.albertjanuar.android.arjuna:attr/lightNeutral)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:78: error: style attribute 'attr/lightNeutralTranslucent (aka com.albertjanuar.android.arjuna:attr/lightNeutralTranslucent)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:49: error: style attribute 'attr/lightPrimary (aka com.albertjanuar.android.arjuna:attr/lightPrimary)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:77: error: style attribute 'attr/lightPrimaryTranslucent (aka com.albertjanuar.android.arjuna:attr/lightPrimaryTranslucent)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:52: error: style attribute 'attr/lightSecondary (aka com.albertjanuar.android.arjuna:attr/lightSecondary)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:79: error: style attribute 'attr/lightSecondaryOpaque (aka com.albertjanuar.android.arjuna:attr/lightSecondaryOpaque)' not found.
bazel-out/darwin-fastbuild/bin/arjuna/databinding-processed-resources/arjuna/arjuna/src/main/res/values/core-styles.xml:50: error: style attribute 'attr/lightStain (aka com.albertjanuar.android.arjuna:attr/lightStain)' not found.

	at com.google.devtools.build.android.CommandHelper.execute(CommandHelper.java:42)
	at com.google.devtools.build.android.AaptCommandBuilder.execute(AaptCommandBuilder.java:297)
	at com.google.devtools.build.android.aapt2.ResourceLinker.linkStatically(ResourceLinker.java:251)
	at com.google.devtools.build.android.ValidateAndLinkResourcesAction.main(ValidateAndLinkResourcesAction.java:207)
	at com.google.devtools.build.android.ResourceProcessorBusyBox$Tool$7.call(ResourceProcessorBusyBox.java:105)
	at com.google.devtools.build.android.ResourceProcessorBusyBox.processRequest(ResourceProcessorBusyBox.java:234)
	at com.google.devtools.build.android.ResourceProcessorBusyBox.main(ResourceProcessorBusyBox.java:177)

thanks!

@arunkumar9t2
Copy link
Contributor

arunkumar9t2 commented Jul 30, 2021

Thanks for reporting, I assume this module compiles successfully with Gradle? If so, could you please check where the missing resources are coming from in Gradle and ensure it is added in deps? If the scripts were generated with Grazel, it is possible Grazel did not add the deps correctly.

@arunkumar9t2 arunkumar9t2 added the needs info Requires more information to proceed label Jul 30, 2021
@ajanuar
Copy link
Contributor Author

ajanuar commented Aug 6, 2021

I ran with native.android_library and it shows the same issue. I think this is related to this issue.

@ajanuar ajanuar closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Requires more information to proceed
Projects
None yet
Development

No branches or pull requests

2 participants