I want to inject my Androidx fragments using dagger 2. In my activity I have:
public class MainActivity extends AppCompatActivity implements HasSupportFragmentInjector { @Inject Repository repository; @Inject DispatchingAndroidInjector<androidx.fragment.app.Fragment> dispatchingAndroidInjector; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public AndroidInjector<androidx.fragment.app.Fragment> supportFragmentInjector() { return dispatchingAndroidInjector; } } the problem is when i want to build the project i get this error:
error: cannot find symbol class MapBuilder and when i change androidx.fragment.app.Fragment to Fragment in DispatchingAndroidInjector i don't get this error any more.