Skip to content

@AssistedInject doesn't work after gradle update #4490

Open

Description

After some dependency updates (incl. version of gradle and kotlin) old code isn't compile anymore in release build

There is error

error: [Dagger/MissingBinding] b.a cannot be provided without an @Inject constructor or an @Provides-annotated method.

Code:

@HiltWorker
class PeriodicReminderWorker @AssistedInject constructor(
    @Assisted context: Context,
    @Assisted workerParameters: WorkerParameters,
    private val reminderProcessor: ReminderProcessor
) : CoroutineWorker(context, workerParameters) {
    override suspend fun doWork(): Result {
        reminderProcessor.invoke(forceUpdateReminders = true)
        return Result.success()
    }
}

In old branch everything works as before
Gradle has been updated from 8.3.2 to 8.7.1
Kotlin - from 2.0.10 to 2.0.21
gradle wrapper - from 8.6 to 8.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions