I am porting my Swing app to Android. I use mail.jar and jscape's secure iNet factory (sinetfactory.jar) for FTP/SFTP/SSH support in my swing app.
Both mail.jar and sinetfactory.jar use the java activation framework (activation.jar) which has java.awt dependencies. The android version of mail.jar and activation.jar are modified to remove this dependency on java.awt.
When I add android mail.jar, activation.jar and sinetfactory.jar to my Android Studio project, I get the following error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/sun/activation/registries/LineTokenizer;
This exact same error has a topic on StackOverflow, but does not apply to my situation. That topic seemed to be a Gradle issue. My issues is that I have 2 libraries with the same dependency (activation framework). I need to use both versions of activation.jar. i.e. mail.jar needs the android modified version of activation.jar, whereas sinetfactory.jar needs the original java version of activation.jar.
What are my options to resolve this issue? Can this be done via some gradle setting?