错误:方法调用不明确。 AppCompactActivity和Activity中的findViewById(int)都 [英] Error : Ambiguous method call. Both findViewById (int) in AppCompactActivity and Activity

查看:1189
本文介绍了错误:方法调用不明确。 AppCompactActivity和Activity中的findViewById(int)都的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Android Studio 3.0 RC1初始化工具栏时收到错误消息:歧义方法调用。我使用AppCompatActivity扩展了我的活动,并使用 compileSdkVersion 26编译了我的应用程序。
附加错误的屏幕截图。

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.

推荐答案

如果您最近已将项目更新为API,请尝试

If you recently updated your project to API, Try doing


文件->无效的缓存/重新启动

File -> Invalidate Caches / Restart

然后


文件->使用Gradle文件同步项目

File -> Sync Project with Gradle Files

这个解决方法对我来说。

this resolve for me.

这篇关于错误:方法调用不明确。 AppCompactActivity和Activity中的findViewById(int)都的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆