google / dagger

A fast dependency injector for Android and Java.
https://dagger.dev
Apache License 2.0
17.36k stars 2k forks source link

error: incompatible types #4128

Closed mobilekosmos closed 8 months ago

mobilekosmos commented 8 months ago

Hello all, just migrating my Android app to ksp and having following issue, any idea how to solve this?

BleWriteDialog_Factory.java:73: error: incompatible types: Single<List<Pair<Device,List<Pair<Sensor,byte[]>>>>> cannot be converted to Single<List<Pair<Device,List<Pair<Sensor,UByteArray>>>>>
    return new BleWriteDialog(ctx, writeCommands, writeStateLoading, writeStateSuccess, writeStateError, onDialogPositiveClick, onDialogNegativeClick, multipleDispensers, manager, scannerRepo, catalogRepo);
class BleWriteDialog @AssistedInject constructor(
    @Assisted("ctx") private val ctx: Context,
    @Assisted("writeCommands") writeCommands: Single<List<Pair<Device, List<Pair<Sensor, UByteArray>>>>>,
public static BleWriteDialog newInstance(Context ctx,
      Single<List<Pair<Device, List<Pair<Sensor, byte[]>>>>> writeCommands,
      Function0<BleDialog.DialogState> writeStateLoading,
      Function0<BleDialog.DialogState> writeStateSuccess,
      Function1<? super Integer, BleDialog.DialogState> writeStateError,
      Function1<? super BleDialog.DialogState, Unit> onDialogPositiveClick,
      Function1<? super BleDialog.DialogState, Unit> onDialogNegativeClick,
      boolean multipleDispensers, BleConnectionManager manager, ScannerRepo scannerRepo,
      CatalogRepo catalogRepo) {
    return new BleWriteDialog(ctx, writeCommands, writeStateLoading, writeStateSuccess, writeStateError, onDialogPositiveClick, onDialogNegativeClick, multipleDispensers, manager, scannerRepo, catalogRepo);
  }
bcorso commented 8 months ago

This looks like the same issue as #4096.

It should be fixed at head. You can try it out using the HEAD-SNAPSHOT artifacts.

mobilekosmos commented 8 months ago

I tried Head but I'm getting many:

[ksp] [Hilt] No property named assistedFactory was found in annotation HiltViewModel: java.lang.IllegalStateException: No property named assistedFactory was found in annotation HiltViewModel

bcorso commented 8 months ago

That sounds like version skew -- i.e. something is not using the HEAD-SNAPSHOT. See https://github.com/google/dagger/issues/3401#issuecomment-1129224521