e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors

老子叫甜甜 提交于 2019-12-01 03:12:49

in my case I was able to find it when the mouse was hovering that line in the build output, as shown here:

without hover:

with hover:

it's really a shame how they show the error, for the simplest error ever, I was trying 10 different solutions as well invalidating the cache and ...

UPDATE:

you can also click here :

and you'll get something like this:

which is very detailed information about the error, I was missing this button in 7 years of Android Development :D

Run ./gradlew build --stacktrace to check the details, which will tell you where the issue happens, something like:

e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors. Could not find accessor xx file:xxx/app/src/main/res/layout/fragment_xxxx.xml Line:108

Sometimes if you changed the property name, especially when changed by refactor => rename, the property name won't be changed in xml automatically.

Mostly this error occurs when the name of the variable passed in the XML file through data binding is incorrect. Just hover over the mouse on the error and you would be able to identify the culprit variable there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!