Unresolved reference, in wrong test scope - Android studio 3.5
Asked Answered
N

2

8

Since I've updated to Android Studio 3.5, in my unit tests Android Studio shows unresolved reference for all the dependencies. The project compiles and the unit test runs successfully but Android Studio shows everything in red.

I've tried to clean, delete build and .gradle folder, invalidate caches but it doesn't work.

Unresolved reference

Nickelson answered 29/8, 2019 at 10:3 Comment(4)
what is mockito version?Passivism
I am using version 2.24.5, but I do not think it is related to mockito because it happens in tests without itNickelson
Maybe not but give it a try for that.Passivism
I've tried and it doesn't workNickelson
S
6

Only workaround to fix this until issue 140375151 is resolved is this:

  1. Put the cursor on one of the affected references
  2. Type alt/options + Enter
  3. Choose Inspection "Unresolved reference, in wrong test scope"
  4. Choose Edit inspection profile setting
  5. Remove the check from the inspection setting to disable it and click OK

The unresolved references should no longer show as unresolved.

Sniper answered 12/12, 2019 at 19:8 Comment(0)
M
4

This Google issue may be related. https://issuetracker.google.com/issues/140375151

Mohammed answered 5/9, 2019 at 12:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.