In addition to the answer above, please make sure that you strictly follow these steps:
I banged my head against a wall and / or any object that I see in front of me to check my SQLite function block. No matter what I do, how strictly follow the advice, provided that my many wise people across the Internet have not worked.
Then I had to go to a preschool and start again to realize my stupid mistake . I found out that AndroidJUnit4 can only be used with Instrumentation Test, and JUnit should be used for local tests. In this case, the folder should be src / androidTest / java . I had a test class right in the androidTest folder, so I had to deal with this nasty bug. However, the moment I moved it to src / androidTest / java, everything became very clear: "I clearly see that the rain has passed."
Take a look at this article that says ...
Run Instrumented Unit Tests Follow these steps to run your instrumental tests:
Make sure your project is in sync with Gradle by clicking Sync Project in the toolbar. Run the test in one of the following ways: to run one test, open the Project window, then right-click the test and select Run. To test all methods in a class, right-click the class or method in the test file and select Run. To run all tests in a directory, right-click the directory and select Run Tests. The Android plugin for Gradle compiles the instrumental test code located in the default directory (src / androidTest / java /), creates a test APK and a working APK, installs both APKs on a connected device or emulator, and runs the tests. Android Studio then displays the results of the instrumented test in the Run window.
Therefore, guys, for instrumentation, the folder should be (do not forget the case)
SRC / androidTest / Java
and for local tests the folder should be
Src / test / java
After that, you can have your own folders for packages that match your application package.
Hope this helps the community!