Errors when commiting ExampleInstrumentedTest class

  android, java

I was working on an android project for about 2 years and all worked well.

I tried to add the project to git today and while committing the project it gave me a warning that I have few errors where one of them is:

Cannot resolve symbol 'AndroidJUnit4'

I never saw this problem before and it suddenly appears.

I tried to rebuild and clean the project as I saw that it was suggested but it didn’t work.

Any ideas why it suddenly happened?

The only places where I see that it appears is at

  1. The build.gradle

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    
  2. ExampleInstrumentedTest.java

    @RunWith(AndroidJUnit4.class)
    

Thank you

Source: Android Questions

LEAVE A COMMENT