Dagger: Fragment injection into AppCompatActivity androidX

Created on 27 Dec 2018  ·  5Comments  ·  Source: google/dagger

Please tell me how to inject Fragment from package androidx.fragment.app.Fragment into androidx.appcompat.app.AppCompatActivity. Exists it interface HasFragmentInjector for a fragment from the new package? 2.20 version

All 5 comments

HasSupportFragmentInjector is probably what you're looking for.

Im still not resolving my problem with HasSupportFragmentInjector which doesn't want fragment from androidx.fragment.app.Fragment package.

zrzut ekranu 2019-01-1 o 23 20 02

I solved the problem.

This is my dependencies:

implement 'com.google.dagger:dagger:2.16'
implement 'com.google.dagger:dagger-android-support:2.16'
kapt 'com.google.dagger:dagger-compiler:2.16'
kapt 'com.google.dagger:dagger-android-processor:2.16'

image

Version 2.16 is supposed to be working.
According to release notes (2.19) version 2.20 should be working to.

In the next release (2.20), we will remove the old format. This will allow us to support AndroidX packages better.
https://github.com/google/dagger/releases/tag/dagger-2.19

Version 2.16 is supposed to be working.
According to release notes (2.19) version 2.20 should be working to.

In the next release (2.20), we will remove the old format. This will allow us to support AndroidX packages better.
https://github.com/google/dagger/releases/tag/dagger-2.19

it's supposed to work in 2.19 but it does not

Was this page helpful?
0 / 5 - 0 ratings