Tester_at_work
Tester_at_work

Reputation: 99

"Cannot resolve symbol............." issue in Android Studio

I am beginner in developing test automation for Mobile apps, and already I am facing "Cannot resolve symbol........." issues. I have also done a "sync to Gradle".

I have a MainActivityTest class which consist of the following :

, As can be seen, the red-colored texts are giving me the issues of "Cannot resolve symbol when mouse-over them.

The following is the Gradle in my app module enter image description here

Hope to have advice as what have I done wrong.

Upvotes: 0

Views: 3646

Answers (1)

Kiran
Kiran

Reputation: 432

Steps you can explore:

Step 1: File > Sync Project with Gradle Files.

Step 2: If it doesn't work even now, File > Invalidate Caches and Restart.

Step 3: After you restart, you can Clean Project, Rebuild Project.

Another Step: File > Close Project, and reopen it.

Edit:

If you didn't find any solution to the problem with the above steps you can follow the following steps.

  1. Close Android Studio.
  2. Let Us consider your project name is ' AndroidProject '.
  3. Go to your project folder (...../AndroidProject/). It will have app/, build/, gradle/, release/ folders and build.gradle, gradlew, gradle.properties, 'gradle.bat, settings.gradle, local.properties` files.
  4. Delete the build/ folder. (Don't worry nothing is going to happen! This folder is something that is generated).
  5. Now navigate into app/, and delete the build/ folder in that as well.
  6. Open Android studio now. The project will rebuild. Your errors will be gone.

Upvotes: 4

Related Questions