Android Studio Says "Cannot Resolve Symbol" But Project Compiles

Android Studio says cannot resolve symbol but project compiles

No idea if this will work or not but my only thought so far: right click the jar file in file tree within AS and select "Add as library..."

EDIT: You can do "File" -> "Invalidate Caches...", and select "Invalidate and Restart" option to fix this.

EDIT 2: This fix should work for all similar incidents and is not a twitter4j specific resolution.

Android Studio “cannot resolve symbol R” but project compiles and runs

For some reason that i do not understand ,

this combination of build versions made the issue :

grade version = 4.10.1

classpath 'com.android.tools.build:gradle:3.4.0-alpha01'

when i switched to these build versions :

grade version = 4.6

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

The issue was solved !

Android Studio suddenly cannot resolve symbols

You've already gone down the list of most things that would be helpful, but you could try:

  • Exit Android Studio
  • Back up your project
  • Delete all the .iml files and the .idea folder
  • Relaunch Android Studio and reimport your project

By the way, the error messages you see in the Project Structure dialog are bogus for the most part.

UPDATE:

Android Studio 0.4.3 is available in the canary update channel, and should hopefully solve most of these issues. There may be some lingering problems; if you see them in 0.4.3, let us know, and try to give us a reliable set of steps to reproduce so we can ensure we've taken care of all code paths.

how to overcome Android Studio cannot resolve symbol for android classes

In the menu bar

Select tools>-android>-SDK manager

and download the SDK build tools, SDK platform and Google API's( the Google API stores packages such as "import android.view.Menu" etc.) for the target SDK version of your project(20 as shown in your screenshot).
if you are not sure which items you have to download , you can select all of them.(will take more time to download of course).

Restart the IDE

Android Studio: cannot resolve symbol R after importing Project from Github and rebuilding/cleaning/syncing with gradle files

Brotherrrrrr, your project uses the 3.3.1 release of the Android Gradle plugin.
Make sure you are using Android Studio 3.3.1 aswell.

Greetings,

Your brotherrrrr

IntelliJ inspection gives Cannot resolve symbol but still compiles code

First of all you should try File | Invalidate Caches and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.

In some weird cases compiled classes may report wrong info and confuse IDEA. Verify that the classes from this jar report correct names using javap.



Related Topics



Leave a reply



Submit