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

后端 未结 17 2129
我寻月下人不归
我寻月下人不归 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:01

    I've had the same issue
    Mine was related to the compileSdkVersion number from build.gradle app.
    Changed to the latest and it worked for me.

    0 讨论(0)
  • 2021-02-05 01:05

    Removing "Android Fast Networking" library solved my problem

    0 讨论(0)
  • 2021-02-05 01:07

    I have recently upgraded to build tools version 27.0.2 and faced the same problem. But noticed that I had the compileSdk version set to 25. Changing compileSdk to 27 resolved the issue.

    0 讨论(0)
  • 2021-02-05 01:08

    if answers does not resolve your problem , you can reset your android studio. I solved with reset my android studio. For reset: https://stackoverflow.com/a/19397632/3129822

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题