this below is the error I get when rebuild
@Binds methods' parameter type must be assignable to the return type
public abstract android.content.res.loader.AssetsProvider localAssetsProvider(@org.jetbrains.annotations.NotNull
//and this also is showing
@Binds methods’ parameter type must be assignable to the return type
//problem seems to come from these tree code
//the class assets provider implementation
class AssetsProviderImpl @Inject constructor(
@ApplicationContext private val context: Context,
): AssetsProvider {
override suspend fun getJsonData(fileName: String) =
context.assets.open(fileName).bufferedReader().use{
it.readText()
}
@SuppressLint("DiscourageApi")
override suspend fun getDrawableResourceId(name: String) =
context.resources.getIdentifier(name, "drawable", context.packageName)
}
//the interface that I created
interface AssetsProvider {
suspend fun getJsonData(fileName: String): String
suspend fun getDrawableResourceId(name: String): Int
}
//the AppProviderModule is where I think the error is
@Module
@InstallIn(SingletonComponent::class)
abstract class AppProviderModule {
@Binds
@Singleton
abstract fun localAssetsProvider(impl: AssetsProviderImpl): AssetsProvider
@Binds
@Singleton
abstract fun boroughsRepositoryProvider(impl: BoroughsRepositoryImpl): BoroughsRepository
}