TestCase class not found by Android Studio

后端 未结 7 1688
刺人心
刺人心 2020-12-03 17:24

I have written a simple test case class and placed it in the default test directory for Android Studio: \"src/androidTest\". I\'ve created an Android Tests build configurati

7条回答
  •  离开以前
    2020-12-03 17:52

    Please post your entire build.gradle file.
    What version of 'com.android.tools.build:gradle' are you using?
    In 0.8, the default test path is "instrumentTest/java/...'.
    In 0.9, the default test path changed to "androidTest/java/...".

    To use androidTest, you should have:

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.9.+'
        }
    }
    

提交回复
热议问题