Cannot resolve symbol 'AndroidJUnit4'

前端 未结 19 2260
别跟我提以往
别跟我提以往 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:34

    Update

    The Android Test Library is now part of AndroidX. Be sure to use the correct Gradle dependencies found in the official documentation.

    Original Answer

    I found here that there are newer versions of the Testing Support Library than what I was using:

    dependencies {
        androidTestCompile 'com.android.support.test:runner:0.5'
        androidTestCompile 'com.android.support.test:rules:0.5'
        androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
    }
    

    Note: Be sure to use the most recent versions of these libraries. This question is from a time when the Android Test Support Library was new and the version numbers here are very out of date.

提交回复
热议问题