Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Error build after implementing library version 2.1.0 #170

Closed
Altitechlab opened this issue Jul 12, 2019 · 6 comments
Closed

Error build after implementing library version 2.1.0 #170

Altitechlab opened this issue Jul 12, 2019 · 6 comments
Labels

Comments

@Altitechlab
Copy link

Altitechlab commented Jul 12, 2019

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.

  • What went wrong:
    Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.

com.android.build.api.transform.TransformException: Error while generating the main dex list.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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:

  • Version: 2.1.0

Could you please help me to resolve this issue?

Thanks in advance.

@Altitechlab Altitechlab changed the title Error build after implement library Error build after implementing library version 2.1.0 Jul 12, 2019
@hdsrob
Copy link

hdsrob commented Jul 21, 2019

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
Copy link
Author

Altitechlab commented Jul 22, 2019

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
Copy link

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

@luizgrp
Copy link
Owner

luizgrp commented Aug 15, 2019

@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
Copy link

kaustav07 commented Aug 20, 2019

@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
Copy link
Owner

luizgrp commented Aug 20, 2019

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants