bazelbuild / bazelbuild/rules_android

databinding error in Android Bazel project

Open
#14 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
203
Forks
95
PR merge metrics
No merged PRs in 30d

Description

Hi @jin,

We are working (@gonzaloruizdevilla) on a project, where the use of databinding functionality is needed, but we encounter the following problem:

build did NOT complete successfully (33 packages loaded, 1068 targets configured)
Internal error thrown during build. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node '//Android/Components/Mobisec-STGAuthenticators-Android/src/main:authenticatorslib BuildConfigurationValue.Key[f3f502b3f0d1aee893a3fe534606da2c] false' (requested by nodes )
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:528)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:399)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.rules.java.JavaCompilationHelper.usesAnnotationProcessing(JavaCompilationHelper.java:433)
at com.google.devtools.build.lib.rules.android.AndroidCommon.initJava(AndroidCommon.java:613)
at com.google.devtools.build.lib.rules.android.AndroidCommon.init(AndroidCommon.java:547)
at com.google.devtools.build.lib.rules.android.AndroidLibrary.create(AndroidLibrary.java:201)
at com.google.devtools.build.lib.rules.android.AndroidLibrary.create(AndroidLibrary.java:43)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:331)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:182)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:767)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:891)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:351)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:451)

Please, could you tell me what the problem is due to.

Are we doing something wrong?

The Build file we use is the following:

#############################################
package(default_visibility = ["//visibility:public"])
load("@rules_jvm_external//:defs.bzl", "artifact")
load("@rules_android//android:rules.bzl", "android_library")

MANIFEST = "AndroidManifest.xml"
PACKAGE = "com.globile.santander.mobisec.authenticators"

android_library(
name = "authenticatorslib",
manifest = MANIFEST,
custom_package = PACKAGE,
enable_data_binding = True,
resource_files = glob(["res/**"]),
srcs = glob(["java/**/*.java"]),
deps = [
"//Android/Components/Mobisec-SCAL-Android/src/main:scallib",
artifact("androidx.appcompat:appcompat"),
artifact("androidx.fragment:fragment"),
artifact("androidx.core:core"),
artifact("androidx.lifecycle:lifecycle-runtime"),
artifact("androidx.lifecycle:lifecycle-viewmodel"),
artifact("androidx.lifecycle:lifecycle-common"),
artifact("androidx.lifecycle:lifecycle-livedata"),
artifact("androidx.lifecycle:lifecycle-extensions"),
artifact("androidx.lifecycle:lifecycle-livedata-core"),
artifact("androidx.drawerlayout:drawerlayout"),
artifact("androidx.annotation:annotation"),
artifact("com.crashlytics.sdk.android:crashlytics"),
artifact("io.fabric.sdk.android:fabric"),
artifact("com.google.code.gson:gson"),
artifact("io.reactivex.rxjava2:rxjava"),
artifact("io.reactivex.rxjava2:rxandroid"),
artifact("org.reactivestreams:reactive-streams"),
artifact("com.journeyapps:zxing-android-embedded"),
artifact("androidx.savedstate:savedstate"),
artifact("com.squareup.okhttp3:okhttp"),
artifact("com.squareup.okhttp3:logging-interceptor"),
artifact("net.zetetic:android-database-sqlcipher"),
artifact("com.google.android.gms:play-services-vision"),
artifact("com.squareup.retrofit2:converter-gson"),
artifact("com.squareup.retrofit2:retrofit"),
artifact("com.squareup.retrofit2:converter-scalars"),
artifact("com.android.support:support-annotations"),
artifact("com.android.support:design"),
artifact("android.arch.lifecycle:extensions"),
artifact("com.android.support:cardview-v7"),
artifact("com.android.support:appcompat-v7"),
artifact("com.android.support.constraint:constraint-layout"),
artifact("com.android.databinding:baseLibrary"),
artifact("com.android.databinding:adapters"),

]
)
######################################

Best Regards.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.