Listener Binding; Cannot Find the Setter

前端 未结 9 2032
梦如初夏
梦如初夏 2020-12-16 10:18

I am trying to implement listener bindings, but when I run my code I get the following error:

Caused by: android.databinding.tool.util.LoggedErrorException: F         


        
9条回答
  •  隐瞒了意图╮
    2020-12-16 11:21

    Valid case: This error is raised if you have an error in the xml file. First read carefully through the xml and if you find a problem fix it.

    Invalid case: For me the issue was raised for a file that was already deleted from the project or the file was renamed and the databinding was referencing the old file.

    I'm not sure how to get rid of the issue every time but I have a number of things that sometimes work and sometimes don't.

    Fix number 1:

    Running 'gradle wrapper' in the project root.

    Fix number 2:

    Android Studio Clean Project

    Next delete these folders in the project root:

    rm -rf .gradle/

    rm -rf app/build/

    rm -rf build

    rm -rf gradle

    rm -rf gradlew

    Android Studio Invalidate and restart

    Everything should be back to normal now.

提交回复
热议问题