Closed seligijus closed 9 years ago
In the meantime it still possible to just create the DaggerComponent using the builder supplied through the Dagger 2.0 generated classes, instead of using mortar's DaggerService.createComponent method. You can then register the created component with the DaggerService and the mortar scope and the component will then be returned with DaggerService.getDaggerComponent.
At least that's how I've been doing it. It should avoid the reflection used in DaggerService's createComponent as well.
Hey,
After Google/Dagger 2.0 release, I get ClassNotFoundException in this line: Class<?> generatedClass = Class.forName(generatedName);
Generated classes are now called DaggerMyCustomComponent instead of DaggerMyCustomComponent, so the problem is in this line: String generatedName = (packageName + ".Dagger" + simpleName).replace('$', '_');
I solved this problem by removing ' ' symbol after .Dagger String generatedName = (packageName + ".Dagger" + simpleName).replace('$', '');