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.
Please share your ideas, if you have any.
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.
That's it, deploy the application and check.