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:

implementation 'com.clover.sdk:clover-android-sdk:262.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:


import com.clover.sdk.util.CloverAccount;
...
function getAccountName() {
  Account account = CloverAccount.getAccount(this.context);
  return account.name;
}



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:


implementation project(':clover-android-sdk')
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 Deactivated 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

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