使用DataBinding框架遇到的错误——找不到符号类 BR 程序包 com.android.databinding.library.baseAdapters app:compileDebugJav

Information:Gradle tasks [:app:assembleDebug]
E:\Working_Files\projects\DataBindingDemo\app\src\main\java\com\****\databindingdemo\activity\ListActivity.java
Error:(8, 52) 错误: 找不到符号
符号:   类 BR
位置: 程序包 com.android.databinding.library.baseAdapters
Error:(11, 53) 错误: 程序包com.***.databindingdemo.databinding不存在
Error:(22, 13) 错误: 找不到符号
符号:   类 ActivityListBinding
位置: 类 ListActivity
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.RuntimeException: Found data binding errors.
****/ data binding error ****msg:Cannot find the setter for attribute '***' with parameter type java.lang.String on android.widget.****View.
file:E:\Working_Files\projects\DataBindingDemo\app\src\main\res\layout\item_list.xml
loc:20:28 - 20:42
****\ data binding error ****
Information:BUILD FAILED
Information:Total time: 1.776 secs
Information:4 errors
Information:0 warnings

Information:See complete output in console


错误原因是ListView的item布局xml文件中有错误导致的,修改之后就可以了。

你可能感兴趣的:(android)