Cannot resolve symbol AndroidJUnit4

前端 未结 8 1361
太阳男子
太阳男子 2021-01-18 02:24

I\'m trying to add loginfacebook for my app. But when I added a repository that is need in doing this. It caused an error. The AndroidJUnit4 cannot resolve now.

8条回答
  •  无人共我
    2021-01-18 03:04

    If this issue is coming after migrating to AndroidX. Do this:-

    1. Correct imports

    import androidx.test.runner.AndroidJUnit4
    

    instead of

    import android.support.test.runner.AndroidJUnit4
    

    2. Correct method

    Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    
    

    instead of

    Context appContext = InstrumentationRegistry.getTargetContext()
    

提交回复
热议问题