Instrumented tests with Espresso

When I insert the import statements according to listing 6.3 the following texts become red:
app, runners, junit.

import androidx.test.core**.app**.ActivityScenario
import androidx.test.core.app.ActivityScenario.launch
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.After
import org**.junit**.Before

What could be wrong ?