Cannot resolve symbol 'AndroidJUnit4'

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

    If anyone still having this issue:

    Cannot resolve symbol 'AndroidJUnit4'

    and using API 27, in the build.gradle which is in the app module, add the following lines:

    testImplementation 'junit:junit:4.12'
    
    // AndroidJUnitRunner and JUnit Rules
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    
    // Espresso dependencies
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    

提交回复
热议问题