error: cannot find symbol import com.gourav.news.databinding.ActivityDetailBindingImpl;

Do the following.

  1. In Android Studio in your Build tab check which gradle task failed:

enter image description here

  1. Select the "Gradle" tab on the top right of Android Studio:

enter image description here

  1. Find the gradle task that failed and double-click it:

enter image description here

  1. Let the gradle task finish and look at the output. It should say "FAILED" and some lines above that it should tell you what the problem is:

enter image description here

In this example the problem is, that I am using a boolean value for the visibility parameter like so: android:visibility="@{true}" when it should be an Integer, but your data binding error will most likely be something else.

  1. Watch this video and take action.

This happened to me when I changed variable name in <data> but forgot to change in the views. After changing it, this error was resolved.