Assert turns red and prompts: Add library ‘Gradle:junit:junit:4.13.2‘ to classpath

Open Project Structure-->Dependencies-->Modules-->app and find junit: 4.13.2, as follows:

See this Dependency. Then, the Configuration in the Details below is currently testImplementation. Change it to Implementation, as follows:

Click "OK" to return. It is found that Assert turns red and disappears, and the problem is solved:

Guess you like

Origin blog.csdn.net/weixin_45046069/article/details/133640292