1

I am doing a project in Android Studio and today I saw that suddenly all my code has errors and even the line:

import com.google.android.gms.appindexing.Action;

has error: cannot resolve symbol android

any suggestions why this might have happened?

4
  • 2
    did you try Build->Clean Project? Commented Jan 28, 2016 at 22:08
  • no what do you mean by that? Commented Jan 28, 2016 at 22:10
  • At top of Android Studio there is the "Build" option, click there and then select "Clean Project". Commented Jan 28, 2016 at 22:18
  • I actually just saw that the folder libs is not loaded in my project for some reason. however it is there in the right path in the directory. Right now build is disabled for me Commented Jan 28, 2016 at 22:39

5 Answers 5

2

Please ensure you have mention in your project grades it has been tested and working fine

dependencies { ... compile 'com.google.android.gms:play-services-appindexing:8.4.0' ... } 

clean your project and rebuild again and wait till android studio make indexing and loaded all resource some time due to system it will slow. please comment if you found something else. happy coding :)

Sign up to request clarification or add additional context in comments.

Comments

0

1st update your SDKs ( Android tools SDK & Google play service)

in your build.gradle "modules" include this code in your dependencies

compile 'com.google.android.gms:play-services-places:<version> 

where is the latest version available...my version at the time of this answer is 11.0.4

Comments

0

Please try as follows

  1. Exit Android Studio
  2. Back up your project
  3. Delete all the .iml files and the .idea folder
  4. Relaunch Android Studio and reimport your project

or

  1. Exit Android Studio
  2. Back up your project or rename your project
  3. Clone new project

Comments

0

solved this issue by -> clean project - > save all - > close all tabs -> Close entire project -> Reopen it again.

The issue solved

Comments

0

What I did: in Android Studio Settings --> Build, Execution, Deployment Build Tools --> Gradle I had set the value of the field Gradle User Home.

I did that, because it was displaying a wrong path (perhaps from an earlier installation?) But what I put in was really a guess.

But it caused several problems, including a thousand warnings "cannot resolve symbol 'android'"

I fixed it by emptying the field (then Clean Project, then in Terminal ./gradlew clean, then File --> Invalidate Caches... because ... who knows? does anybody really know?)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.