I need to use Bouncy Castle with android (specifically for ECDHE). I included Bouncy Castle as a dependency in my gradle project file following: How to add Bouncy Castle algorithm to Android? I got the following error on compilation:
Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.
Going through this link: https://developer.android.com/studio/build/multidex I found that multidex apps can have efficiency and security issues.
I then decided to manually add the needed classes from the library to my project as advised here: Using Bouncy Castle library causes massive increase in output .jar file size. This, however got too tedious.
Is there a better way to achieve what I need?