question

victorespina avatar image
victorespina asked victorespina commented

Getting classDefNotFound exception when using class from AAR

I am trying to create a Clover Flex app with Ionic, using a Cordova plugin that runs code from an external AAR library that contains all the clover-related code.

In the AAR gradle file I link the clover's SDKs using:

  1. implementation 'com.clover.sdk:clover-android-sdk:262.2'
  2. implementation 'com.clover.sdk:clover-android-connector-sdk:262.2'


This allows me to compile my AAR library without problems, but when I actually call this code from my plugin:


  1. import com.clover.sdk.util.CloverAccount;
  2. ...
  3. function getAccountName() {
  4. Account account = CloverAccount.getAccount(this.context);
  5. return account.name;
  6. }



I am getting a classDefNotFound exception for the CloverAccount class. I am trying this on an actual DevKit device, so It seems like the SDK libraries are not available on the device. I also tried to download the actual SDK files and link them to my project using:


  1. implementation project(':clover-android-sdk')
  2. implementation project(':clover-android-connector-sdk')


but the code fails with the same error.


What am I missing ?

Clover Android SDK
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian answered victorespina commented
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

victorespina avatar image victorespina commented ·

Thanks. Adding multidex support didn't fix my problem, but adding clover's SDK to my cordova plugin dependencies did the trick. I now can get the Clover's account but... now it get stucked creating the PaymentConnector... so, back to search the web :). Thanks for your help.

0 Likes 0 ·

Write an Answer

HTML Editor


Add some details...
Characters : 0
Tab to the formatting toolbar with Alt/Option + F10. If inside toolbar, press ESC to return to editor. Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community