[In-App Chat Mobile] Error in plugin

[In-App Chat Mobile] Error in plugin

  
Forge Component
(5)
Published on 2017-11-27 by Labs
5 votes
Published on 2017-11-27 by Labs

Hello


The In-App-Chat-Mobile plugin uses the Plugin File Viewer plugin as a requirement, however it does not allow compiling into android and ios with the following error:


Calling plugman.fetch on plugin "https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#0.0.1.os"

saving

Running command: npm install https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#0.0.1.os --production --save

Command finished with error code 1: npm install, https: //github.com/OutSystemsExperts/File-Viewer-Plugin.git#0.0.1.os,--production,--save

Error: Failed to fetch plugin https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#0.0.1.os via registry.

Probably this is either a connection problem, or a plugin spec is incorrect.

Check your connection and plugin name / version / URL.

Error: npm: Command failed with exit code 1 Error output:

npm ERR! code ENOPACKAGEJSON

npm ERR! package.json Non-registry package missing package.json: git + https: //github.com/OutSystemsExperts/File-Viewer-Plugin.git#0.0.1.os.

npm ERR! package.json npm can not find a package.json file in your current directory.


Is there any way to adjust this?


Eurico Junior

As of this month July 2018, I am encountering the exact same problems with generating native apps. Compiling is stopped because the plugin cannot be fetched. Fileviewer plugin is one example, but the console log plugin has a similar problem. It looks like these plugins are missing a package.json file? Earlier, that did not seem to be a problem, but maybe changes to the Outsystems' MABS caused these native app generating problems this month? Any suggestions? My build log with the error is shown below:


[2018-07-25T14:55:39.250Z] [INFO] Start processing job request...
[2018-07-25T14:55:39.256Z] [INFO] Start generating application...
[2018-07-25T14:55:39.256Z] [INFO] Nativizer version: 1.1.x
[2018-07-25T14:55:39.256Z] [INFO] Template version: 3.0.1
[2018-07-25T14:55:39.256Z] [INFO] Creating a temporary folder for the application...
[2018-07-25T14:55:39.256Z] [INFO] Creating the required directory structure for your cordova application...
[2018-07-25T14:55:43.657Z] [INFO] Getting application resources...
[2018-07-25T14:55:43.672Z] [INFO] Processing application resources...
[2018-07-25T14:55:43.989Z] [INFO] Generating application assets...
[2018-07-25T14:55:46.582Z] [INFO] Applying configurations in the config.xml file...
[2018-07-25T14:55:46.591Z] [INFO] Applying advanced configurations in the config.xml file...
[2018-07-25T14:55:46.591Z] [INFO] Applying custom application icons...
[2018-07-25T14:55:46.591Z] [INFO] Applying custom application splashscreens...
[2018-07-25T14:55:46.591Z] [INFO] Applying application preferences...
[2018-07-25T14:55:46.596Z] [INFO] Writing your cordova preferences...
[2018-07-25T14:55:46.596Z] [INFO] Applying application accessList...
[2018-07-25T14:55:46.596Z] [INFO] Adding target platform...
[2018-07-25T14:57:58.707Z] [INFO] Applying plugins in the config.xml file...
[2018-07-25T14:57:58.707Z] [INFO] Plugin Id: https://github.com/apache/cordova-plugin-dialogs.git
[2018-07-25T14:57:58.707Z] [INFO] Plugin Action: add
[2018-07-25T14:58:06.634Z] [INFO] Plugin Id: https://github.com/apache/cordova-plugin-file.git
[2018-07-25T14:58:06.634Z] [INFO] Plugin Action: add
[2018-07-25T14:58:15.294Z] [INFO] Plugin Id: https://github.com/OutSystems/Calendar-PhoneGap-Plugin.git#4.5.5
[2018-07-25T14:58:15.294Z] [INFO] Plugin Action: add
[2018-07-25T14:58:21.721Z] [INFO] Plugin Id: https://github.com/OutSystems/cordova-plugin-camera#2.3.2-OS
[2018-07-25T14:58:21.721Z] [INFO] Plugin Action: add
[2018-07-25T14:58:33.855Z] [INFO] Plugin Id: https://github.com/OutSystems/cordova-plugin-audiorecorder
[2018-07-25T14:58:33.855Z] [INFO] Plugin Action: add
[2018-07-25T14:58:42.237Z] [INFO] Plugin Id: https://github.com/Xakal7/cordova-plugin-sketch.git#v1.0.0
[2018-07-25T14:58:42.237Z] [INFO] Plugin Action: add
[2018-07-25T14:58:48.415Z] [INFO] Plugin Id: https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0
[2018-07-25T14:58:48.415Z] [INFO] Plugin Action: add
[2018-07-25T14:58:51.943Z] [INFO] Plugin Id: https://github.com/OutSystems/cordova-plugin-local-notifications.git#0.8.9-OS2
[2018-07-25T14:58:51.943Z] [INFO] Plugin Action: add
[2018-07-25T14:59:03.948Z] [INFO] /tmp/build/source/resources0
[2018-07-25T14:59:03.948Z] [INFO] Plugin Action: add
[2018-07-25T14:59:10.325Z] [INFO] Plugin Id: https://github.com/dariosalvi78/cordova-plugin-health.git
[2018-07-25T14:59:10.325Z] [INFO] Plugin Action: add
[2018-07-25T14:59:18.889Z] [INFO] Plugin Id: https://github.com/lhdmulder/cordova-plugins-OpenIn
[2018-07-25T14:59:18.895Z] [INFO] Plugin Action: add
[2018-07-25T14:59:26.291Z] [INFO] Plugin Id: https://github.com/apache/cordova-plugin-inappbrowser
[2018-07-25T14:59:26.292Z] [INFO] Plugin Action: add
[2018-07-25T14:59:36.731Z] [INFO] Plugin Id: https://github.com/OutSystems/cordova-plugin-secure-storage.git#v2.6.3
[2018-07-25T14:59:36.731Z] [INFO] Plugin Action: add
[2018-07-25T14:59:43.659Z] [INFO] Plugin Id: https://github.com/OutSystems/OneSignal-Cordova-SDK.git#2.0.12-OS4
[2018-07-25T14:59:43.659Z] [INFO] Plugin Action: add
[2018-07-25T15:00:02.782Z] [INFO] Plugin Id: https://github.com/lhdmulder/cordova-plugin-edit-plist-file.git
[2018-07-25T15:00:02.782Z] [INFO] Plugin Action: add
[2018-07-25T15:00:16.176Z] [ERROR]
You have been opted out of telemetry. To change this, run: cordova telemetry on.
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0"
saving
Running command: npm install https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0 --production --save
Command finished with error code 1: npm install,https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0,--production,--save
Error: Failed to fetch plugin https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: git+https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mabs02/.npm/_logs/2018-07-25T14_58_51_895Z-debug.log

[2018-07-25T15:00:16.176Z] [ERROR] Build failed with the following error: Error fetching Cordova plugin: https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.0.0.
[2018-07-25T15:00:16.176Z] [INFO] Zipping application source...
[2018-07-25T15:00:33.025Z] [INFO] Application was not successfully generated!
[2018-07-25T15:00:33.025Z] [INFO] Execution time: 294534ms

Hello Eurico and Denis,


It seems there was an update to MABS and plugins now require a package.json file. This one clearly does not and its owners should update it to address this.

Thanks... I'll wait.

Thanks, I will wait too. I guess there is a whole range of plugins not working anymore. Do all owners know this is an issue that should be fixed??

I do not think so. I could not find any information related to this on the site. A quick search on the web shed some light on this error for me. Perhaps there are not that many plugins in need of this file. I guess all we can do is wait and/or raise awareness every time we encounter this when using plugins.

Hi, 

 Have you all tried getting the latest plugins from Forge and generate the build , by any change if issue resolves ?

Hi,

Same problem with one of our custom plugins - it had package.json, but apparently in wrong format.

This piece of information helped a lot - Generating a package.json for a Cordova plugin

Here are the instructions, in case the link goes dead:

-----------

In order to ease the creation of a valid package.json file, you can use the plugman NPM package to do it. It will inspect the plugin's plugin.xml file. In order to do so:

  1. Install Node.js
  2. Install the plugman NPM package, using "npm install -g plugman"
  3. Fetch the plugin using Git, using "git clone <plugin URL>"
    1. If the plugin is included within a Zip Resource file, you should instead extract its contents to a folder
    2. If the plugin is specified via NPM identifier, there should be no issue, as these packages already required the file in place
  4. Use the "plugman createpackagejson <path to the plugin's root folder>" command to start a wizard before creating the file; this wizard will have default answers derived from the corresponding "plugin.xml" file
  5. Place the generated "package.json" file into the root folder of your plugin
    1. If you are not the owner of the plugin on GitHub, you can fork it and use the "Upload Files" option to create it; don't forget to update your module to point to the forked repository URL
    2. If the plugin is included via a Zip resource, just add it to the archive and update the resource on the module
  6. Refresh references of your mobile app and try generating the app again

------------