Sometime ago I wanted to use the new Material Components for Android
So I Followed their getting-started.md instructions and also updated to android studio 3.3 canary 6, and did all the migrate to androidx.
But after that I experienced some wired things, but the most bothering one is with moshi, I was using this code: ("it" is String with json)
val moshi = Moshi.Builder()
.add(KotlinJsonAdapterFactory())
.build()
val adapter = moshi.adapter(Events::class.java)
val events = adapter.fromJson(it)
And when I build it's yelling:
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory;, unresolved supertypes: Lcom.squareup.moshi.JsonAdapter.Factory;Task :app:compileDebugKotlin FAILED
When I go to the declaration it is all good.
Does someone experienced it and know how to solve it? I'm not using proguard and disabled enableR8 in gradle.
Also I have those enabled:
android.enableJetifier=true
android.useAndroidX=true
-- Update --
After understanding that those the enableJetifier do, I created a new project only with moshi, did the same thing and with the enableJetifier to false it worked perfectly, BUT I must use the jetifier for dagger.
does anyone know how to exclude projects from jetifier?