【发布时间】:2018-11-13 09:55:12
【问题描述】:
我在 Bitbucket 中有以下分支:https://bitbucket.org/ali-rezaei/tmdb/src/dataBinding/
我在构建项目时遇到Kotlin compiler 错误:
e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors.
错误与:
app:visibleGone="@{isLoaded}"
在以下布局中:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="isLoaded"
type="boolean" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.MainActivity">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:visibleGone="@{isLoaded}" />
</android.support.v4.widget.SwipeRefreshLayout>
<include
layout="@layout/network_state_item"
app:visibleGone="@{!isLoaded}" />
</FrameLayout>
</layout>
如果您能帮助我,我将不胜感激。
【问题讨论】:
-
app:visibleGone。贴@BindingAdapter注解方法 -
我很好奇是不是因为你的变量类型,如果你把
boolean改成Boolean会发生什么?甚至java.lang.Boolean? -
@Aaron,我收到了同样的错误信息。
标签: android kotlin android-databinding