Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin: Binding Library NoClassDefFoundError for $$Lambda$1 class

beh3dbeh3d USMember

I am trying to use an ResearchStack AAR library in Xamarin. To do so, I created a separate VS Solution in which I've added all dependencies to the AAR library through additional binding projects and referenced all in the main binding project.

The binding project does build properly (with some warnings though, but they are not related to my problem).

Then, when I use the generated DLL in my other solution, it works until the point that the library tries to call $$Lambda$1 class. At that point I receive
Java.Lang.NoClassDefFoundError
Failed resolution of: Lorg/researchstack/backbone/ui/step/layout/SurveyStepLayout$$Lambda$1;

If you refer to the picture above, before I added rxjava-1.1.3.jar as embedded jar to Binding-BackBone, the project was generating warnings on $$Lambda$1 classes not found. But once I did at the jar to the binding project, those errors are gone so I expected that the DLL does not generate the same error afterwards.

Note: the library is built using gradle. I tried both build-tools-23 and build-tools-25 and didn't have any luck.

Any suggestions?

Answers

  • tuyenvtuyenv VNUniversity ✭✭✭

    I checked that ResearchStack library referenced to a lot of other dependencies.

    Plz make sure to have them all by packages/JARs/AARs.

    To isolate the issues, it's better to give each JAR/AAR a binding project.

    Cheers.

  • beh3dbeh3d USMember

    @tuyenv said:
    I checked that ResearchStack library referenced to a lot of other dependencies.

    Plz make sure to have them all by packages/JARs/AARs.

    To isolate the issues, it's better to give each JAR/AAR a binding project.

    Cheers.

    I've included all the dependencies in the Binding projects (most of them have a separate binding as you see in the picture Rx1,Rx2 etc.) But still no luck.

    Each one of the binding projects generate some warnings although not too serious and not directly related to the issue here.

    I figured it might be an issue with handling Lambda functions in the java library. Is there a proper way to handle it if it is the case?

  • HashimKSHashimKS USMember ✭✭

    @beh3d Did u check adding the dependency jar files to the android project as well?

  • wodwobwodwob Member ✭✭

    Did you find a solution for this ? I'm facing a similar issue

Sign In or Register to comment.