Clean-Android-Code icon indicating copy to clipboard operation
Clean-Android-Code copied to clipboard

Resolve DaggerDeps

Open hafs-r opened this issue 7 years ago • 4 comments

import com.plaps.androidcleancode.deps.DaggerDeps;

import com.plaps.androidcleancode.deps.Deps; import com.plaps.androidcleancode.networking.NetworkModule;

import java.io.File;

/**

  • Created by ennur on 6/28/16. */ public class BaseApp extends AppCompatActivity{ Deps deps;

    @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); File cacheFile = new File(getCacheDir(), "responses");

deps = DaggerDeps.builder().networkModule(new NetworkModule(cacheFile)).build();

}

public Deps getDeps() {
    return deps;
}

}

How to resolve DaggerDeps ?

hafs-r avatar Nov 02 '16 07:11 hafs-r

just clean and rebuild your project

nrohmen avatar Nov 02 '16 07:11 nrohmen

@hafsalrahman DaggerDeps is generated from Deps . . . it will generated when you build the project, since Deps is dagger component (have annotation @Component). . . .

let say you create component interface MyComponent, then you will have generated like DaggerMyComponent . . .

CMIIW

herisulistiyanto avatar Dec 05 '16 05:12 herisulistiyanto

Why didn't generated DaggerDeps? I followed yours steps and code , just didn't work.

fushen0 avatar Dec 01 '17 09:12 fushen0

File->Other Settings->Default Settings->Build,Execution,Deployment->Compiler->Annotation Processors->Enable Annotation Processing->Apply->Ok After this go to Build->Rebuild Project This should solve your problem. If it doesn't ping me up using @knightcube

knightcube avatar Jan 25 '18 05:01 knightcube