43

Good day, I'm just upgrading my android studio to the latest version (3.6.1) and I'm just want to try the new features of version 3.6.1 which is the ViewBinding. I followed the setup instruction from this site https://developer.android.com/topic/libraries/view-binding?utm_medium=studio-assistant-stable&utm_source=android-studio-3-6 but I don't know why I'm still having this error: Cannot resolve symbol 'ResultProfileBinding'

enter image description here

Here is what I've done. But still getting that cannot resolve symbol error.

enter image description here enter image description here enter image description here

My android studio 3.6.1 is the latest stable version that I've downloaded from the official website and the viewbinding feature is on the list of new features of this version so I am sure that I am missing something. Does anyone know how to solve this?

Noryn Basaya
  • 664
  • 1
  • 5
  • 21

3 Answers3

117

It's based on your layout file name. If your layout's filename is activity_language.xml then your binding class would be ActivityLanguageBinding.

a_local_nobody
  • 7,947
  • 5
  • 29
  • 51
Shaun Mathew
  • 1,186
  • 1
  • 6
  • 2
  • 1
    Yes, it works! my mistake was I didn't read the first part of the page https://developer.android.com/topic/libraries/view-binding?utm_medium=studio-assistant-stable&utm_source=android-studio-3-6#top_of_page which is they mention your answer. – Noryn Basaya Mar 01 '20 at 23:16
  • 4
    everyone has who landed here was using ResultProfileBinding :-D – Tejas May 06 '20 at 06:08
  • 1
    from the docs `The name of the binding class is generated by converting the name of the XML file to camel case and adding the word "Binding" to the end.` – Someone Somewhere May 19 '20 at 18:10
0

I had the same issue with Fragment layout file: fragment_xyz.xml

The auto complete will do the rest for start typing XyzFragmentBinding...

hoomi
  • 99
  • 1
  • 4
0

you can find the file in

project_dir/app/build/generated/data_binding_base_class_source_out/debug/out

inmyfree
  • 11
  • 3