Lauren Yew
03/30/2022, 4:27 PM@Composable
interface methods getting AbstractMethodError
issues?
I have a simple interface that I'm using with Hilt to pass Compose Theme components back to a library.
import androidx.compose.material.Colors
import androidx.compose.runtime.Composable
interface DevSettingsMaterialTheme {
@Composable
fun devSettingsLightColors(): Colors?
...
}
class SampleDevSettingsMaterialTheme : DevSettingsMaterialTheme {
@Composable
override fun devSettingsLightColors(): Colors? = null // crashes w AbstractMethod
...
}
The library itself was able to implement the interface no problem, and I have tested with one app and it works fine, but another sample app where I'm using the same library (same gradle plugin version 7.1.0 + kotlin version 1.6.10, Java version 11, compose version 1.1.1), when I run the app and try to use the library feature, I get the error
java.lang.AbstractMethodError: abstract method "androidx.compose.material.Colors com...android.devsettings.di.DevSettingsMaterialTheme.devSettingsLightColors(androidx.compose.runtime.Composer, int)"
.
Any ideas on how I can work around this? Thanks!Adam Powell
03/31/2022, 1:52 AMComposer, int
args