А
Size: a a a
А
r
А
r
r
r
А
АМ
r
А
А
r
EP
СГ
СГ
СГ
F
МE
class SendNotifyWorker @WorkerInject constructor(получаю исключение:
@Assisted private val context: Context,
@Assisted private val workerParameters: WorkerParameters,
private val getEventByIdInteractor: GetEventByIdInteractor,
private val notificationHelper: NotificationHelper
) : Worker(context, workerParameters) {
@HiltAndroidApp
class AndroidApp : Application(), Configuration.Provider {
@Inject
lateinit var workerFactory: HiltWorkerFactory
.................
override fun getWorkManagerConfiguration() =
Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()
2020-07-27 10:10:00.970 21826-21933/com.lamp.planner E/WM-WorkerFactory: Could not instantiate com.lamp.planner.presentation.background.workmanager.SendNotifyWorkerт.е. он ищет конструктор с двумя параметрами. Посмотрел HiltWorkerFactory, там про inject доп. параметров вообще ничего нет:
java.lang.NoSuchMethodException: <init> [class android.content.Context, class androidx.work.WorkerParameters]
if (factoryProvider == null) {
return null;
}
return factoryProvider.get().create(appContext, workerParameters);
SP