Cucumber-jvm 要么指定的参数不匹配以下任何一个构造函数:[private java.lang.Class()];

Cucumber-jvm Either the specified parameters do not match any of the following constructors: [private java.lang.Class()];

我正在 Android 上测试一个简单的 Cucumber BDD 测试并得到一个 Cucumber 错误

org.picocontainer.PicoCompositionException: Either the specified 
parameters do not match any of the following constructors: [private 
java.lang.Class()]; OR the constructors were not accessible for 
'java.lang.Class'

我不知道这个错误是从哪里来的。 我错过了什么吗?

我的专题文件

Scenario Outline: Test scenario
    Given I have a TestActivity
    Then I should see <text> on the display

Examples:
    | text |
    | 123  |
    | test |

步骤定义

@CucumberOptions(features = "features", format = "pretty")
public class TestActivitySteps extends ActivityInstrumentationTestCase2<TestActivity> {

    public TestActivitySteps(Class<TestActivity> activityClass) {
        super(activityClass);
    }

    @Given("^I have a TestActivity$")
    public void I_have_a_TestActivity() {
        assertNotNull(getActivity());
    }

    @Then("^I should see (\S+) on the display$")
    public void I_should_see_s_on_the_display(final String s) {
        onView(withText(s)).check(matches(isDisplayed()));
    }
}

注意:

我想通了。此构造函数触发了错误。

public TestActivitySteps(Class<TestActivity> activityClass) {
    super(activityClass);
}

改成

后错误消失了
public TestActivitySteps(TestActivity activityClass) {
    super(activityClass);
}