1

I have two modules('app' and 'mlib') in my project and app module depends on mlib module.

In the mlib module I am using cordova.jar file as a library.

Now in order to execute any method of mlib module its asking me to add cordova.jar file again. so I added same jar file in my app module also. If I am removing jar file from app module, I am getting error

Cannot access org.cordova.CordovaPlugin

So currently I have cordova.jar file present in both mlib and app module.

Now when I am trying to run the application, I am getting error

com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/Config

I have also added below dexOptions in my app level build.gradle file but no luck.

dexOptions {
        incremental false
        preDexLibraries = false
        jumboMode = false
        javaMaxHeapSize "2048M"
    }

build.gradle file of mlib module:

build.gradle file of mlib module

Error that I am getting while building:

Error that I am getting while building

James Z
  • 12,209
  • 10
  • 24
  • 44
Anand
  • 19
  • 2
  • Possible duplicate of [Multiple dex files define Lorg/apache/cordova/BuildHelper](https://stackoverflow.com/questions/46562289/multiple-dex-files-define-lorg-apache-cordova-buildhelper) – Gautam Surani Jun 20 '18 at 12:56
  • @GautamSurani I already have checked the link that u are reffering. I am using Android Studio and dont have cordova cli installed in my system So I can't execute the command mentioed in the other link. – Anand Jun 20 '18 at 20:21

0 Answers0