Search code examples
javacordovacordova-pluginsoracle-maf

Oracle MAF : Deployment error when using cordova plugin


I have tried to integrate cordova plugin into Oracle MAF application for accessing different feature like Image Capture, Audio and Video.

For sample, I have tried with cordova-plugin-media-capture from Github. Following is the workaround, I have added downloaded plugin into Additional Plugins in MAF application.

Please note, I have plugin outside of the project since I got issue when having it inside the project. (You may get the details by checking edit history of this post).

Now when I try to deploy the app i'm getting INTERNAL_ERROR, below is the stacktrace for your reference.

Error Log:

[06:07:41 PM] Installing "org.apache.cordova.network-information" for android
[06:07:41 PM] Installing "cordova-plugin-media-capture" for android
[06:07:41 PM] Fetching plugin "cordova-plugin-file" via plugin registry
[06:07:41 PM] Error Code : INTERNAL_ERROR
[06:07:41 PM] npm http GET http://registry.cordova.io/cordova-plugin-file
[06:07:41 PM] npm oracle.maf.mafhelper.api.MafHelperException: oracle.maf.mafhelper.api.MafHelperException: java.lang.Exception
[06:07:41 PM] at oracle.maf.mafhelper.internal.utils.MafHelperInternalUtilities.runProcess(Unknown Source)
[06:07:41 PM] at oracle.maf.mafhelper.internal.utils.MafHelperInternalUtilities.executeCmd(Unknown Source)
[06:07:41 PM] at oracle.maf.mafhelper.internal.utils.MafHelperInternalUtilities.addPlugin(Unknown Source)
[06:07:41 PM] at oracle.maf.mafhelper.internal.utils.MafHelperInternalUtilities.deploy(Unknown Source)
[06:07:41 PM] at oracle.maf.mafhelper.MafHelperMain.main(Unknown Source)
[06:07:41 PM] Caused by: oracle.maf.mafhelper.api.MafHelperException: java.lang.Exception
[06:07:41 PM] ... 5 more
[06:07:41 PM] Caused by: java.lang.Exception
[06:07:41 PM] at oracle.maf.mafhelper.api.MafHelperException.<init>(Unknown Source)
[06:07:41 PM] ... 5 more
[06:07:41 PM] Picked up _JAVA_OPTIONS: -Xmx512M
[06:07:41 PM] Shutting down Android Debug Bridge server...
[06:07:41 PM] Deployment cancelled.
[06:07:41 PM] ----  Deployment incomplete  ----.
[06:07:41 PM] An error occurred deploying Cordova plugins. (oracle.adfmf.framework.dt.deploy.android.deployers.plugins.AndroidPluginDeployer)

I googled and got the link for this issue. Below are my try, But none of them works.

  • Shorten android sdk path, application path, plugin path.
  • All path without space.
  • Ran the JDeveloper as Administrator.

Please share your ideas, if you have any.


Solution

  • To resolve this issue, Keep the plugin outside of the project (Your local drive of the system) and refer in the maf-application.xml file using below steps.

    • Go to Application Resources block in JDeveloper.
    • Open maf-application.xml under Description -> ADF META-INF folder.
    • maf-application.xml file gets open, make sure you have select the Overview mode.
    • Then follow this tutorial (Registering Additional Plugins in Your MAF Application) for adding additional plugin (which you want to use).
    • Make sure you have unchecked unwanted Core-Plugins (Like Camera - when you add cordova media capture plugin). Since this lets to conflict MAF application, which one need to be used while building the deployment file.
    • You can open maf-plugin.xml file to confirm whether additional plugin have been added or not.

    That's it, deploy the application and check.