Error : Ambiguous method call. Both findViewById (int) in AppCompactActivity and Activity

Sumit T picture Sumit T · Oct 24, 2017 · Viewed 27.6k times · Source

I am getting the error: "Ambiguous method call" on initializing Toolbar using Android Studio 3.0 RC1. I have extended my Activity with AppCompatActivity and compiling my application using 'compileSdkVersion 26'. Attaching a screenshot of the error.enter image description here

Answer

Upendra Shah picture Upendra Shah · Jul 2, 2018

If you recently updated your project to API, Try doing

File -> Invalidate Caches / Restart

then

File -> Sync Project with Gradle Files

this resolve for me.