Android 找不到符号变量DaggerTestComponent
我正在尝试注入我的应用程序组件 因为我用的是这个样板Android 找不到符号变量DaggerTestComponent,android,dagger-2,Android,Dagger 2,我正在尝试注入我的应用程序组件 因为我用的是这个样板 private void setupDaggerTestComponentInApplication() { WSApplication application = WSApplication.get(mContext); mTestComponent = DaggerTestComponent.builder() .applicationTestModule(new ApplicationTestMo
private void setupDaggerTestComponentInApplication() {
WSApplication application = WSApplication.get(mContext);
mTestComponent = DaggerTestComponent.builder()
.applicationTestModule(new ApplicationTestModule(application))
.build();
application.setComponent(mTestComponent);
}
这位于新的测试文件夹中:
sourceSets {
def commonTestDir = 'src/commonTest/java'
test {
java.srcDir commonTestDir
}
androidTest {
java.srcDir commonTestDir
}
}
DAGGER_VERSION = '2.11-rc2'
输出:
error: cannot find symbol variable DaggerTestComponent
有什么想法吗?谢谢whats is{it.unitTestVariant.dirName}的可能重复,我只是使用java而没有在这一文件夹中进行测试谢谢但它没有解决我的问题whats is{it.unitTestVariant.dirName}?的可能重复,我只是在这一文件夹中使用java而没有测试谢谢但它没有解决我的问题