0

I upgraded to Android Studio to 2021.3.1 Patch 1 and all the build tools at the same time. The tests were running without fail so I worked out stuff for a few day, but when I went to add a new test, I noticed all of the dependencies to the project itself are red. If I try to add them, it says "add dependency on module 'x.x.x.main'. Doing that adds this little ditty to the app gradle, which does nothing.

androidTestImplementation project(path: ':app')

In the test class itself, the some dependencies are found, like..

import org.mockito.MockitoAnnotations;
import java.io.File;
import java.util.ArrayList;
import static org.junit.Assert.assertNotEquals;
import static org.mockito.ArgumentMatchers.any;

but project specific dependencies and imports are not, between the \ show in red. If I click on anything before the red, it takes me to test folder for it, not the app main..

import io.reactivex.rxjava3.core.\Observable\;
import io.reactivex.rxjava3.observers.\DisposableObserver\;
import com.x.x.\AnyFile\;

Yet, when I run the tests, they run as expected with no issue. Project structure hasn't changed.

app
 ->src
   ->main
   ->test

It's like the test info UI wise is pointing to the wrong folder, but the actual tests aren't. Anyone encountered this or know how this could be happening and have a solution?

a54studio
  • 965
  • 11
  • 11
  • After a day it, I wound up adding a testDebug folder, copying everything over to it. Oddly, it now recognized the dependencies for the project, but wouldn't run the tests because they were now duplicates. I then deleted the test folder and everything acts as it should. – a54studio Oct 20 '22 at 16:54

0 Answers0