Fixed
Status Update
Comments
uc...@google.com <uc...@google.com> #2
Not reproduced, Can you share a sample project to reproduce this issue.
ww...@gmail.com <ww...@gmail.com> #3
Looks like another key step is inflating the layout. See attached project.
Databinding V2 caused additional errors, so it's present but disabled in the project's gradle.properties.
Databinding V2 caused additional errors, so it's present but disabled in the project's gradle.properties.
ww...@gmail.com <ww...@gmail.com> #4
A couple SO users seem also to have run across this:
*https://stackoverflow.com/q/50755768/android-databinding-swallows-errors-from-other-compilers
*https://stackoverflow.com/q/51206308/appkaptdevdebugkotlin-failed-build-exception-cannot-find-symbol-databindingco
*https://stackoverflow.com/q/50519224/loggederrorexception-found-data-binding-errors
*
*
*
uc...@google.com <uc...@google.com> #5
Not reproduced with DatabindErrors project.
sm...@gmail.com <sm...@gmail.com> #6
I also ran into this issue with data binding errors in Kotlin files. The issue is I'd expect to see the full error message without having to click the toggle in the Build view. My issue is the key bit would get cut off and I couldn't dynamically click to the spot to repair the error. I never had to click that button for a Java based data binding error, and in fact didn't realize the button existed until I reviewed this ticket and the screen shot from #5.
So while not blocked, the user experience is less than desired. The problem exists in AS 3.2 and AS 3.3 Canary 13
Android Studio 3.2
Build #AI-181.5540.7.32.5014246, built on September 17, 2018
JRE: 1.8.0_152-release-1136-b06 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
Android Studio 3.3 Canary 13
Build #AI-182.4505.22.33.5035453, built on September 27, 2018
JRE: 1.8.0_152-release-1248-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
So while not blocked, the user experience is less than desired. The problem exists in AS 3.2 and AS 3.3 Canary 13
Android Studio 3.2
Build #AI-181.5540.7.32.5014246, built on September 17, 2018
JRE: 1.8.0_152-release-1136-b06 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
Android Studio 3.3 Canary 13
Build #AI-182.4505.22.33.5035453, built on September 27, 2018
JRE: 1.8.0_152-release-1248-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
uc...@google.com <uc...@google.com>
yb...@google.com <yb...@google.com>
da...@google.com <da...@google.com>
da...@google.com <da...@google.com> #7
This feature should start showing up whenever a 3.5 canary lands. Please keep an eye out and reply here or open new issues if you have any feedback. Thanks!
da...@google.com <da...@google.com> #8
(Note: You may also need to use the latest version of the Gradle plugin for this feature to start working, if it's not working for you immediately)
da...@google.com <da...@google.com> #9
Quick update: Errors should show up even without the latest Gradle plugin starting in 3.5 canary 2, whenever that lands.
Background, for the curious: The latest data binding code rides along with the Android Gradle plugin, and in 3.5, the way data binding error messages have been encoded changed. At the same time, the Build Output window feature was added, and used this newer encoding. We've additionally added support for messages that use the legacy encoding as well.
Background, for the curious: The latest data binding code rides along with the Android Gradle plugin, and in 3.5, the way data binding error messages have been encoded changed. At the same time, the Build Output window feature was added, and used this newer encoding. We've additionally added support for messages that use the legacy encoding as well.
ak...@gmail.com <ak...@gmail.com> #10
What is the difference between DataBinding Generated Files FragmentPlantListBinding and FragmentPlantListBindingImpl?
da...@google.com <da...@google.com> #11
Bug reports aren't the best place to have conversations like this. How about posting the question to reddit (
Description
If there are any errors from the data binding processor, they aren't displayed in the Build tool window.
# Steps to reproduce
1. Add data binding library to an Android project's Gradle script (as per documentation). The databinding compiler can be added with either the "kapt" or "annotationProcessor" Gradle directives (both result in the same issue).
2. Add data binding to a (new or existing) layout file.
3. Introduce an error to the layout file (e.g. don't define a variable, or reference a non-existent property). For example (layout named databind_errors.xml; also attached):
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="
<data>
<variable name="name" type="String" />
</data>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Identifiers must have user defined types from the XML file. nonesuch is missing it -->
<TextView
android:id="@+id/missing_variable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{nonesuch}" />
<!-- Could not find accessor java.lang.String.nonexistent -->
<TextView
android:id="@+id/no_such_property"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{name.nonexistent}" />
</LinearLayout>
</layout>
4. Make the project via (e.g.) Build→Make Project, the "Make Project" button in the toolbar.
The build should fail.
# Expected result
The build fails, and messages from the data binding compiler relating to the data binding errors are displayed in the Build pane, referencing the error locations.
# Actual result
The build fails, but error messages relating to the underlying data binding errors aren't shown. Instead, the build pane shows the error:
e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors.
Depending on what references the data binding and which errors are present, other error messages may be displayed in the build panel, but they don't point to the data binding error. For example, I've seen:
* "cannot find symbol private final [package path].databinding.DatabindErrorsBinding mboundView0;"
* "cannot generate view binders android.databinding.tool.util.LoggedErrorException: failure, see logs for details."
Attached is the sample layout with errors, and full Gradle output for the build task run on a project containing it.
# Workaround
Run the build task (for root or :app) in the Gradle panel, which displays the raw output.
# System Info
Build: 3.1.3, AI-173.4819257, 201806041730,
AI-173.4819257, JRE 1.8.0_152-release-1024-b01x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.12.6 unknown, screens 1280x800
Android Gradle Plugin: 3.1.3
Gradle: 4.4
NDK: from local.properties: 17.1.4828580; latest from SDK: 17.1.4828580;
LLDB: pinned revision 3.1 not found; latest from SDK: (package not found);
CMake: from local.properties: (not specified); latest from SDK: (not found); from PATH: 3.11.4;