Android Question

Cannot resolve symbol "preference"

I am building an Android TV app and want to use

LeanbackListPreferenceDialogFragment


However, the Studio says "Cannot resolve symbol "preference" on my import string:

import android.support.v17.preference.LeanbackListPreferenceDialogFragment;


I have the leanback library dependency added in my build.gradle:

compile 'com.android.support:leanback-v17:25.0.0'


The link to API reference: https://developer.android.com/reference/android/support/v17/preference/LeanbackListPreferenceDialogFragment.html

Any hints and help is appreciated.

Eugene

Answer

You are missing

compile 'com.android.support:preference-leanback-v17:25.0.0'

See here for more details

If that works, be sure to accept this answer.

Comments