Android Studio fails to generate databinding after 3.1.0 update

前端 未结 20 2929
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 02:40

This morning I made an update to android studio from 3.0.1 to 3.1.0. After updating the gradle to latest version I still get build error regarding

20条回答
  •  遥遥无期
    2020-12-15 03:19

    This might not be the most helpful answer, but in my case this was caused by a completely unrelated issue in my code.

    I was receiving 51 error: cannot find symbol: DataBindingComponent errors (in every single Data Binding generated class), and I spent ages removing changes to my XML and ViewModel code trying to find what was causing it.

    The problem actually lay in an invalid change I made a Room model. I guess that a Room error might have been obfuscated by all the databinding errors, but the Debug/Scan logs in the terminal didn't point to it.

    So review all recent code, even seemingly unrelated changes if you encounter this problem.

    Edit: See this SO post about these databinding errors obfuscating other kapt issues (like Room / Dagger)

提交回复
热议问题