Error Junit:Junit:4.12 not found or missing after Android Studio 1.4 to 1.5 update

After I updated Android Studio from 1.4 to 1.5, all went well and the patch got applied. However, when starting the project, I got an error that read something like this.
Error Junit:Junit:4.12 not found or missing

This error occurred due to gradle not getting updated / synced properly. Apparently, to speed up Android Studio, I had checked the Offline Work checkbox as in this post.

To fix the error, uncheck the Offline Work checkbox, apply the change and restart Android Studio. You will notice that gradle then syncs. Once the sync is complete you can go back and check the box once more, or just continue working. The JUnit error will no longer appear.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s