源代码文件无法解析符号“ R”

时间:2019-04-02 09:29:40

标签: android

我最近看到AlertDialog,我想看一下他的源代码,进行跟进,找到AlertController文件,然后在其AlertController .setupView()方法中,

final View parentPanel = mWindow.findViewById(R.id.parentPanel);
final View defaultTopPanel = parentPanel.findViewById(R.id.topPanel);
final View defaultContentPanel = parentPanel.findViewById(R.id.contentPanel);
final View defaultButtonPanel = parentPanel.findViewById(R.id.buttonPanel);

提示我无法解析符号'R',如果我想查看相应的xml文件,或者可以单击,该怎么办?

AlertController .setupView()

final View parentPanel = mWindow.findViewById(R.id.parentPanel);
final View defaultTopPanel = parentPanel.findViewById(R.id.topPanel);
final View defaultContentPanel = parentPanel.findViewById(R.id.contentPanel);
final View defaultButtonPanel = parentPanel.findViewById(R.id.buttonPanel);

1 个答案:

答案 0 :(得分:0)

关闭项目。删除项目的.gradle和.idea文件夹,然后重新打开项目。然后尝试重新构建,然后就可以了。

否则,请尝试使缓存无效并重新启动。