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

后端 未结 17 2145
我寻月下人不归
我寻月下人不归 2021-02-05 00:29

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 appli

17条回答
  •  余生分开走
    2021-02-05 01:11

    This can suddenly appear when running a code analyzer like FindBugs-IDEA. A quick way to clear the warning is to temporarily change the buildToolsVersion in your app/build.gradle then change it back again.

    For example, follow these steps:

    1. Open your app/build.gradle file.
    2. Change buildToolsVersion to '26.0.1' then sync project (press the 'Sync Now' button when it appears at the top)
    3. Change the buildToolsVersion back to whatever you had before.
    4. Press the 'Sync Now' button

    This should clear the error.

提交回复
热议问题