The project has been using dagger for a couple of years. The procedure of generating app component is quite standard, there is a DaoComponent interface:
@Component(modules = {DaoModule.class})
public interface DaoComponent {
void inject(PostsRepository postsRepository);
}
And we create an instance of it via DaggerDaoComponent.builder().build() in Application class:
private static DaoComponent diDaoComponent;
@Override
public void onCreate() {
super.onCreate();
application = this;
diDaoComponent = DaggerDaoComponent.builder().build();
}
And after updating to Android Studio 4.2 I can not start a project anymore. It seems that it can't generate DaggerDaoComponent, there are two errors in build logs:
cannot find symbol
import com.zeen.core.di.component.DaggerDaoComponent;
^
symbol: class DaggerDaoComponent
location: package com.zeen.core.di.component
and:
java.lang.NoClassDefFoundError: javax/annotation/Generated
I would assume that NoClassDefFoundError is the reason why the app can't compile and thus can't generate DaggerDaoComponent, the problem is specifically related to AS 4.2 since after downfrade to 4.1.3 all is good. Did anyone encounter such a problem?