Unresolved reference, in wrong test scope - Android studio 3.5

有些话、适合烂在心里 提交于 2020-01-13 09:58:14

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/57707769/unresolved-reference-in-wrong-test-scope-android-studio-3-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!