GenericWorkItem is not public in JobIntentService

Viewed 160

After migrating my code to AndroidX, I am getting this

error :GenericWorkItem is not public in JobIntentService; cannot be accessed from outside package

@Override
    GenericWorkItem dequeueWork() {
        try {
            return super.dequeueWork();
        } catch (SecurityException ex) {
            LogUtil.info(TAG, "ignored "+ex.getMessage());

        }
        return null;
    }

This is my code block which is giving error.

1 Answers

Most likely this class is in the android.support.v4.app package. To solve the problem, move this class to the androidx.core.app package. Then android.support.v4.app package can be removed.

Related