Skip to main content
Visitor II
March 15, 2019
Solved

ST25SDK on VisualStudio + Xamarin

  • March 15, 2019
  • 10 replies
  • 3265 views

Hi,

I'm developping an application for Android on VisualStudio with Xamarin.

I implemented the ST sdk, interfaces and the « ST driver » Tagdiscovery.

But at the execution, In the « PerformTagDiscovery » into TagDiscovery class, the line « tagInfo.nfcTag = new ST25DVTag(readerInterface, uid); » generate an exception :

Java.Lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/lang3/BitField;

I try to implement manually Commons-Lang from apache on VisualStudio, but not possible, there is many and many error ....

Is that a solution ?

    This topic has been closed for replies.
    Best answer by xNiux

    I finally found the solution. I add to my project the commons-lang3-3.8.1.jar (found on the apache site), and set it in « AndroidJavaLibrary).

    And all it’s now ok.

    10 replies

    ST Employee
    March 15, 2019

    Hi,

    The ST25 SDK indeed has a dependency on org.apache.commons:commons-lang3.

    In Android App, we manage that thanks to Gradle. We had the following dependency in "build.gradle":

    implementation 'org.apache.commons:commons-lang3:3.5'

    I don't know it is done in Xamarin but I expect that you can specify the dependencies somewhere. I don't think that implementing Commons-Lang manually is the good solution.

    Regards

    Olivier

    xNiuxAuthor
    Visitor II
    March 18, 2019

    Yes, it was my conclusion ... But in Xamarin, the org.apache.commons seems to be not completely implemented ... In mono-android, there is only the org.apache.commons.logging which are implemented ....

    ST Employee
    March 18, 2019

    I don't have Xamarin knowledge to give you advices. 'org.apache.commons:commons-lang3:3.5' is prety common so do you know how the other Xamarin users are managing the dependency? Is there some threads on StackOverflow?

    For your information, we are using the following classes of 'org.apache.commons:commons-lang3:3.5':

    org.apache.commons.lang3.StringUtils;

    org.apache.commons.lang3.BitField;

    org.apache.commons.lang3.ArrayUtils;

    xNiuxAuthorAnswer
    Visitor II
    March 18, 2019

    I finally found the solution. I add to my project the commons-lang3-3.8.1.jar (found on the apache site), and set it in « AndroidJavaLibrary).

    And all it’s now ok.

    ST Employee
    March 18, 2019

    Good! I'm glad that you found a way to add this library. Well done!

    Best regards

    Olivier

    Visitor II
    October 18, 2021

    Hi xNiux

    I was searching St25Sdk for my Xamarin Android project, I was wondering if you could share your Xamarin version of St25SDK, I would be very grateful if you could share it.

    Visitor II
    August 18, 2022

    Hi xNiux,

    I've been trying to fix this for weeks. If you feel like it, could you share your project so I can understand where I'm wrong?

    Thankyou so much,

    Davide.

    xNiuxAuthor
    Visitor II
    August 19, 2022

    OK, so you can found my ST25SDK project joined to this message.

    But my project was closed by my leader 3 years ago :(

    Visitor II
    August 19, 2022

    Hi xNiux,

    I'm so sorry that your leader close your project.

    Thankyou so much for the dll. I tried to implement it but still no result. I realize that is asking you a lot. Could you also share the Xamarin project?

    Thanks a lot,

    Davide.

    xNiuxAuthor
    Visitor II
    August 19, 2022

    Mmmh, it is a little bit complicated ... This was a confidential project ...

    But I will try to unzip, update and compile it ... If all it's ok, I will clean it, to have a healthy base project.

    Visitor II
    August 22, 2022

    I realize it's not that simple.

    If you can I thank you so much otherwise it doesn't matter. You've already helped me a lot

    xNiuxAuthor
    Visitor II
    August 23, 2022

    Ok, I reopened my archive. I update it on VS2022 and modern Android SDK. It compile !!!

    So, I cleaned the code. Please find zip file joined to this message. My Emulator doesn't run, so ... Compilation is OK, but ... Running on Android could be crash :)

    Visitor II
    August 23, 2022

    Super. Thankyou so much.

    Davide.

    xNiuxAuthor
    Visitor II
    August 23, 2022

    Let me know about it :)