8

Today, I upgrade stable release of Android Studio 3.3 and then I realize that the common action go to declaration by Cmd + Left Click or Cmd + B does not work anymore. Instead, It goes to declaration in R.java

Now, I must double shift on layout/drawable/mipmap file to go to it's declaration. But, this action does not work with resource id/color/string... So, now it is hard to find out input value from resource.

Is there anyway to make this function back? I think it really helpful.

Any suggestion is appreciate

Robust
  • 2,415
  • 2
  • 22
  • 37

3 Answers3

11

I have faced same issue. After spending so much time on this i found proper solution for this.

1). Upgrade your project gradle like

 classpath 'com.android.tools.build:gradle:3.3.0'

If this not work than try below method

2). Just delete

.gradle
.idea
build 

folder from your project and reopen the project. and it will solve this issue.

If you have multiple module in your project than remove all those folder from all modules.

Hope this will work for you as it worked for me.

Lokesh Desai
  • 2,607
  • 16
  • 28
6

Its not removed. Its working fine.

You can do following things:

  1. You can restart Android Studio
  2. May be you are clicking on removed ID or STRING or COLORS. So may be that is available in R.java but removed from directory. You can clean project and try again.
  3. Even If its not working, You can use Invalidate Cache and Restart option.

Hope 2nd point is happened to you.

Thank you.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
-1

Press Ctrl + Shift + A, and search for the command you're looking for ("declaration") for example. This finds the command "Declaration - Goto by Reference action - Ctrl + B".

So you just need to put your cursor on the method you want to go to, and press Ctrl + B? You can also Ctrl + Click to achieve the same goal.

The most useful keyboard shortcuts are described in the Help

NOTE:- Please restart your studio & wait until Gradle will be built successfully.

  • 1
    This doesn't solve the problem, but is a shortcut to highlight the problem. Instead of the goto declaration going to a layout xml file, it now goes to the declaration in the generated R.java file. – DMonkey Jan 31 '19 at 09:33