luizgrp / SectionedRecyclerViewAdapter

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
MIT License
1.68k stars 372 forks source link

Error build after implementing library version 2.1.0 #170

Closed Altitechlab closed 5 years ago

Altitechlab commented 5 years ago

Dear Supporters,

I want to use this library on my project, but after I implementation the library version 2.1.0 as below:

implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:2.1.0'

Then I ran my project and I got an error:

:app:transformClassesWithMultidexlistForDebug FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 4s

This is my build tool of my project: android { compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { multiDexEnabled true minSdkVersion 19 targetSdkVersion 26 } SectionedRecyclerViewAdapter library:

Could you please help me to resolve this issue?

Thanks in advance.

hdsrob commented 5 years ago

Ran into the same error while adding this library to a new project.

It's likely that the error is related to the use of Java 8: https://stackoverflow.com/questions/49512629/default-interface-methods-are-only-supported-starting-with-android-n

Changing Source and Target Compatibility fixed the issue for me.

Altitechlab commented 5 years ago

Hi Hdsrob, Thanks for your comments. I solved it. But seem there is another issue. I used this method, but seems it didn't work. new Handler().postDelayed(new Runnable() { @Override public void run() { mRecyclerView.scrollToPosition(position); } }, 300); Did you meet this issue? and how to resolve it? Thanks for your support.

kaustav07 commented 5 years ago

I already have Java 8 Enabled in my projects but still get that same error on build, any solution yet?

luizgrp commented 5 years ago

@MathiewNguyen could you please open ask a question on Stackoverflow providing more details, like what's the error you are getting?

@kaustav07 did you try the solution proposed by @hdsrob ?

kaustav07 commented 5 years ago

@luizgrp I have already Java 8 enabled which was @hdsrob 's solution, but still it was not working, currently I am using version 1.2.0 of this library which is working fine.

luizgrp commented 5 years ago

@kaustav07 it's hard to give a solution with too little information about your project. Could you please create a project from scratch and add the library and see if it works? If it doesn't could you please add to a repository in your github account and share with us? Please keep this in mind when creating it. You can also check the demo app configurations, which is working with the current version of the library.