0

I have following dependencies in my gradle file :

gradleVersion = '3.3.0'
kotlinVersion = '1.3.11'
supportLibraryVersion = '1.1.0-alpha01'
ktxCoreVersion = '1.1.0-alpha03'
daggerVersion = '2.19'

Libs = [
            kotlin          : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlinVersion}",
            appCompat       : "androidx.appcompat:appcompat:${supportLibraryVersion}",
            ktxCore         : "androidx.core:core-ktx:${ktxCoreVersion}"
    ]

    Dagger = [
            dagger              : "com.google.dagger:dagger:${daggerVersion}",
            daggerCompiler      : "com.google.dagger:dagger-compiler:${daggerVersion}",
            daggerAndroid       : "com.google.dagger:dagger-android:${daggerVersion}",
            daggerAndroidSupport: "com.google.dagger:dagger-android-support:${daggerVersion}",
            daggerProcessor     : "com.google.dagger:dagger-android-processor:${daggerVersion}"
    ]

For some reason daggerAndroidSupport is not compatible with AndroidX. I receive following error when I build the project:

ERROR: Failed to resolve: fragment
Affected Modules: app 

Anyone know a solution for this?

Addenda:

I am using Android Studio 3.3, and here is a link to sample project : https://drive.google.com/file/d/15PsnOKfEyI91Pr350SHuN6TGuN7QCa7F/view?usp=sharing

Ali
  • 9,800
  • 19
  • 72
  • 152
  • You can try using either `2.20` or `2.21` daggerVersion – EpicPandaForce Jan 21 '19 at 15:01
  • I tried both versions but problem still exist. – Ali Jan 21 '19 at 15:05
  • Could you add to the question, the error generated by the dagger? and add more information of the androidx imports (fragments, activity, etc), currently I have a project with androidx and it works correctly with dagger – Juanes30 Jan 24 '19 at 14:45
  • @JuanE.LondoñoT. which version of Android studio are you using? please take a look on `Addenda` section in my question. – Ali Jan 25 '19 at 17:54
  • in the code that you share, I do not see code that implements dagger, I only see that you add the dependencies of dagger. in the same way download the project and as it compiles without problems, to validate it would be good to add the code where you perform the dependency injection with dagger. in the following link you can see the compilation result https://imgur.com/a/LnBiMh0 – Juanes30 Jan 25 '19 at 18:45
  • But I can't build the project. For some reason it fails during build. which version of Android Studio are you using? – Ali Jan 25 '19 at 18:56

0 Answers0