Skip to content Skip to sidebar Skip to footer

Androidtestcompile Dependencies Not Recognized In The Imports

Actually, my project has unit tests. All of them are configured in /src/test/java/ Recently I needed to add instrumentation tests in /src/androidTest/java. To do that I have added

Solution 1:

You might need to rebuild the project.

In Android Studio:

Build -> Rebuild project.

If it doesn't help run the following gradle task (given that you have a wrapper and your module name is "app"):

./gradlew app:dependencies

and make sure your androidTest tasks contain espresso dependencies.

Update:

Sometimes rebuilding the project doesn't solve the problem and the only solution is to rebuild the test apk manually by executing gradle assembleAndroidTest task.

Post a Comment for "Androidtestcompile Dependencies Not Recognized In The Imports"