Thank you for answer. So basically, there's no point of integrating the code directly and I should create a NS plugin. So I tried - I built aar from my java code, I put it into platform/android/lib of my plugin, created TS wrapper. When I try to build my application, the build fails:
Build file '<app>/platforms/android/build.gradle' line: 704
* What went wrong:
Execution failed for task ':myMergeDex'.
> Could not find matching constructor for: com.android.dx.merge.DexMerger([Lcom.android.dex.Dex;, com.android.dx.merge.CollisionPolicy)
Which is this line:
def dexMerger = new com.android.dx.merge.DexMerger(dexArr, com.android.dx.merge.CollisionPolicy.FAIL)
What am I doing wrong in my setup?
EDIT: Clearing platform folder and building the app again helped