Cannot resolve symbol 'AndroidJUnit4'

前端 未结 19 2229
别跟我提以往
别跟我提以往 2020-12-02 08:48

Obviously I need the correct import statment to solve this problem. According to the docs for AndroidJUnit4, this should be

import android.support.test.runn         


        
19条回答
  •  抹茶落季
    2020-12-02 09:28

    Short Story Version:

    Upgrade your Gradle to the latest Version

    I am answering this question post on Feb, 15th, 2020. Unfortunately, I have exhausted every possible solutions mentioned here and elsewhere.

    • https://github.com/codepath/android_guides/wiki/UI-Testing-with-Espresso

    • https://github.com/udacity/AdvancedAndroid_TeaTime/issues/14

    • Android Espresso : cannot resolve symbol AndroidJUnit4.class

    • Cannot resolve symbol AndroidJUnit4

    • Android Espresso : cannot resolve symbol AndroidJUnit4.class

    Yes, none of them above workes. I use the built-in function, "Migrate to Andoridx", it may remind me that I have to upgrade my target SDK versions and my gradle version. After I upgraded my gradle version from 2.0.2 to 3.5.3. They just works, even the old import statement works.

提交回复
热议问题