Hi guys, in this case, I started a new project with kotlin & androidx setup as the main menu (main library). By default, the generated project is not immediately clean (aka not clean code, that's what the masters there say). One example is the title of this topic.
Curious about what it looks like? Here it is:
Warning because this deprecated can actually still be implemented in the project, but for those of you who adhere to the clean code & scalable ideology, small problems like this cannot be ignored. I used to ignore it, but now, I have repented, so whatever is possible I will make clean code & scalable. So what do I need to do to solve this problem? don't go anywhere, see my action in the next paragraph!
First add the following dependencies in your application level gradle, then sync it properly.
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
Next, correct the ExampleInstrumentedTest class by removing this import dependency,
import androidx.test.runner.AndroidJUnit4
Next, move the cursor to [AndroidJUnit4::class](androidjunit4::class) which is highlighted in red, click ALT+ENTER, select the one without a strikethrough, this one:
import androidx.test.ext.junit.runners.AndroidJUnit4
Okay, that's it, done! Good Job!