小编nem*_*emo的帖子

Dagger2生成的类突然从Android Studio中丢失

我已经在Android Studio中使用Dagger2已经好几个月了,但今天它突然停止工作并且给我以下错误

 error: cannot find symbol
        return Dagger_Injector.builder()
               ^

symbol:   variable Dagger_Injector
  location: class Initializer
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Run Code Online (Sandbox Code Playgroud)

这是失败的代码

@Singleton
@Component(modules = {TestService.class, ServiceFactory.class})
public interface Injector {

    public final static class Initializer {

        public static Injector init(ApplicationLoader app, boolean bypassVerification) {
            return Dagger_Injector.builder()
                    .testService(new TestService())
                    .serviceFactory(new ServiceFactory(app))
                    .build();
        } …
Run Code Online (Sandbox Code Playgroud)

android build gradle dagger-2

15
推荐指数
1
解决办法
9425
查看次数

标签 统计

android ×1

build ×1

dagger-2 ×1

gradle ×1