AndroidJUnit4.class is deprecated: How to use androidx.test.ext.junit.runners.AndroidJUnit4?

前端 未结 8 1673
傲寒
傲寒 2020-12-04 08:04

For my instrumentation tests I was using

@RunWith(AndroidJUnit4.class)

from

import androidx.test.runner.AndroidJUnit4;
         


        
8条回答
  •  无人及你
    2020-12-04 08:34

    If you imported those AnroidX test libraries, synced and re-built the project, but the imported packages were still not resolved. Just remember how you upgraded your project to AndroidX, close Android Studio and remove the .idea folder and reopen your project again...

    This worked for me !

提交回复
热议问题