0

I was making an application (API 26) which uses RecyclerView. I use the following line in my build l.gradle

dependencies {
    implementation 'com.android.support:recyclerview-v7:28.0.0'
}

But however this doesn't work of API 26. Is there any way that I can use Recyclerview for API 26. Thank you!

13
  • 2
    I recommend you to use androidX library instead of support library
    – AgentP
    Jul 3, 2020 at 6:25
  • developer.android.com/topic/libraries/support-library/packages - check this link. Share your code for more information.
    – learner
    Jul 3, 2020 at 6:26
  • AgentP can you elaborate on the topic Jul 3, 2020 at 6:32
  • 1
    @KaranGandhi to elaborate a bit on AndroidX: The android.support classes are all deprecated, no longer receiving bug fixes or new features, and should not be used in new code. You should migrate to AndroidX.
    – Ryan M
    Jul 3, 2020 at 7:38
  • 2
    My guess is that your compile SDK is set too low, and you need to increase it to at least 28, which won't affect anything other than allowing you to compile against libraries that use newer APIs. Let me know if that fixes your problem, and I can post it as an answer if it does.
    – Ryan M
    Jul 3, 2020 at 7:44

1 Answer 1

0

Why don't you use androidX? To know more details about it you can visit https://developer.android.com/jetpack/androidx

dependencies {
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
3
  • Will I have to change any code which I have written? Jul 3, 2020 at 7:15
  • While I agree with this advice, I'm not sure how it could solve the problem.
    – Ryan M
    Jul 3, 2020 at 7:35
  • androidx supports almost all the previous version of the android. You can learn more from here, developer.android.com/jetpack/androidx You can use android studios migrate to androidX function. it will do all the required changes and also backup your code too. In case the operation fails or doesn't work for you, than you can revert.
    – towhid
    Jul 3, 2020 at 10:20

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.