Error installing cordova-plugin-firebase': TypeError: Path must be a string

Hi All,

We are using firebase cordova plugin in our mobile application.

Plugin Config : 

{
    "plugin":
    {
        "url": "https://github.com/TruewindIT/cordova-plugin-firebase#1.9"
    }
}

MABS Version : 5.2

Note : working fine in dev and tst environment

We are facing below while generating .apk and .ipa file.

[2020-02-06T09:33:41.314Z] [INFO] Start processing job request...
[2020-02-06T09:33:41.318Z] [INFO] Start generating application...
[2020-02-06T09:33:41.319Z] [INFO] Template version: 5.4.0
[2020-02-06T09:33:41.320Z] [INFO] Build features: cordovaNoFetch - true
[2020-02-06T09:33:41.320Z] [INFO] Build features: buildTimeout - 20
[2020-02-06T09:33:41.321Z] [INFO] Creating a temporary folder for the application...
[2020-02-06T09:33:41.321Z] [INFO] Creating the required directory structure for your cordova application...
[2020-02-06T09:33:47.019Z] [INFO] Getting application resources...
[2020-02-06T09:33:47.053Z] [INFO] Processing application resources...
[2020-02-06T09:33:47.608Z] [INFO] Generating application assets...
[2020-02-06T09:33:47.926Z] [INFO] Applying configurations in the config.xml file...
[2020-02-06T09:33:47.939Z] [INFO] Applying advanced configurations in the config.xml file...
[2020-02-06T09:33:47.940Z] [INFO] Applying custom application icons...
[2020-02-06T09:33:47.948Z] [INFO] Applying custom application splashscreens...
[2020-02-06T09:33:47.949Z] [INFO] Applying application preferences...
[2020-02-06T09:33:47.957Z] [INFO] Writing your cordova preferences...
[2020-02-06T09:33:47.957Z] [INFO] Applying application accessList...
[2020-02-06T09:33:47.958Z] [INFO] Adding target platform...
[2020-02-06T09:34:20.623Z] [INFO] Applying plugins in the config.xml file...
[2020-02-06T09:34:20.625Z] [INFO] Plugin Id: https://github.com/aportuguesecoder/cordova-plugin-networkinterface.git
[2020-02-06T09:34:20.625Z] [INFO] Plugin Action: add
[2020-02-06T09:34:22.948Z] [INFO] Plugin Id: https://github.com/adriano-di-giovanni/cordova-plugin-shared-preferences.git
[2020-02-06T09:34:22.949Z] [INFO] Plugin Action: add
[2020-02-06T09:34:25.328Z] [INFO] Plugin Id: https://github.com/creacore-team/cordova-plugin-calllog.git
[2020-02-06T09:34:25.328Z] [INFO] Plugin Action: add
[2020-02-06T09:34:27.852Z] [INFO] Plugin Id: https://github.com/SwapnilShinde89/clevertap-cordova.git
[2020-02-06T09:34:27.852Z] [INFO] Plugin Action: add
[2020-02-06T09:34:31.240Z] [INFO] Plugin Id: https://github.com/guyromb/Cordova-open-native-settings.git
[2020-02-06T09:34:31.240Z] [INFO] Plugin Action: add
[2020-02-06T09:34:33.613Z] [INFO] Plugin Id: https://github.com/Rareloop/cordova-plugin-app-version#v1.0.0
[2020-02-06T09:34:33.613Z] [INFO] Plugin Action: add
[2020-02-06T09:34:35.630Z] [INFO] Plugin Id: https://github.com/apache/cordova-plugin-file.git#4.3.3
[2020-02-06T09:34:35.630Z] [INFO] Plugin Action: add
[2020-02-06T09:34:38.861Z] [INFO] Plugin Id: https://github.com/OutSystemsExperts/outsystems-app-store-launcher-plugin.git
[2020-02-06T09:34:38.862Z] [INFO] Plugin Action: add
[2020-02-06T09:34:41.312Z] [INFO] Plugin Id: https://github.com/OutSystems/cordova-plugin-geolocation.git#4.0.1-OS1
[2020-02-06T09:34:41.313Z] [INFO] Plugin Action: add
[2020-02-06T09:34:44.512Z] [INFO] Plugin Id: https://github.com/kelter-antunes/cordova-plugin-android-permission.git
[2020-02-06T09:34:44.512Z] [INFO] Plugin Action: add
[2020-02-06T09:34:46.882Z] [INFO] Plugin Id: https://github.com/OutSystemsExperts/cordova-plugin-file-transfer.git#1.5.1.os
[2020-02-06T09:34:46.882Z] [INFO] Plugin Action: add
[2020-02-06T09:34:49.382Z] [INFO] Plugin Id: https://github.com/OutSystemsExperts/File-Viewer-Plugin.git#1.1.1
[2020-02-06T09:34:49.382Z] [INFO] Plugin Action: add
[2020-02-06T09:34:51.422Z] [INFO] Plugin Id: https://github.com/OutSystems/cordova-plugin-inappbrowser.git#3.1.0-OS3
[2020-02-06T09:34:51.422Z] [INFO] Plugin Action: add
[2020-02-06T09:34:54.213Z] [INFO] Plugin Id: cordova-plugin-sim@1.3.3
[2020-02-06T09:34:54.213Z] [INFO] Plugin Action: add
[2020-02-06T09:34:55.464Z] [INFO] Plugin Id: https://github.com/floatinghotpot/cordova-plugin-sms.git
[2020-02-06T09:34:55.464Z] [INFO] Plugin Action: add
[2020-02-06T09:34:57.989Z] [INFO] Plugin Id: https://github.com/TruewindIT/cordova-plugin-firebase#1.9
[2020-02-06T09:34:57.989Z] [INFO] Plugin Action: add
[2020-02-06T09:35:08.401Z] [ERROR] Executing script found in plugin clevertap-cordova for hook "before_plugin_add": plugins/clevertap-cordova/scripts/androidBeforeBuild.js
Resolving module name for fs => fs
Resolving module name for path => path
AMAL: Came into scriptCalling plugman.fetch on plugin "https://github.com/TruewindIT/cordova-plugin-firebase#1.9"
Fetching plugin "https://github.com/TruewindIT/cordova-plugin-firebase" via git clone
Running command: git clone https://github.com/TruewindIT/cordova-plugin-firebase /tmp/git/1580981698860
Command finished with error code 0: git clone,https://github.com/TruewindIT/cordova-plugin-firebase,/tmp/git/1580981698860
Running command: git checkout 1.9
Command finished with error code 0: git checkout,1.9
Repository "https://github.com/TruewindIT/cordova-plugin-firebase" checked out to git ref "1.9".
/tmp/build/source/plugins/cordova-plugin-firebase"...
Plugin "cordova-plugin-firebase" fetched.
Calling plugman.install on plugin "/opt/NativeBuilder/builds/0d906795-53d0-4f3b-861e-e6c7ca88b61f/source/plugins/cordova-plugin-firebase" for platform "android
Installing "cordova-plugin-firebase" for android
Running command: /opt/NativeBuilder/builds/0d906795-53d0-4f3b-861e-e6c7ca88b61f/source/platforms/android/cordova/version
Command finished with error code 0: /opt/NativeBuilder/builds/0d906795-53d0-4f3b-861e-e6c7ca88b61f/source/platforms/android/cordova/version
Finding scripts for "before_plugin_install" hook from plugin cordova-plugin-firebase on android platform only.
Executing script found in plugin cordova-plugin-firebase for hook "before_plugin_install": plugins/cordova-plugin-firebase/scripts/configurations/installDependencies.js
7.1.0
Resolving module name for child_process => child_process
Resolving module name for q => q
Executing script found in plugin cordova-plugin-firebase for hook "before_plugin_install": plugins/cordova-plugin-firebase/scripts/configurations/unzipAndCopyConfigurations.js
7.1.0
7.1.0
Resolving module name for q => q
7.1.0
Resolving module name for elementtree => elementtree
7.1.0
Using deprecated way to look for configuration files' folder
No file found
Failed to install 'cordova-plugin-firebase': TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1233:7)
    at module.exports (/opt/NativeBuilder/builds/0d906795-53d0-4f3b-861e-e6c7ca88b61f/source/plugins/cordova-plugin-firebase/scripts/configurations/unzipAndCopyConfigurations.js:53:29)
    at runScriptViaModuleLoader (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:18)
    at runScript (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:164:16)
    at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:132:20
    at _fulfilled (/usr/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/lib/node_modules/cordova/node_modules/q/q.js:557:44
Error: Path must be a string. Received undefined

[2020-02-06T09:35:08.401Z] [ERROR] Build failed with the following error: Error installing Cordova plugin: cordova-plugin-firebase.
[2020-02-06T09:35:08.401Z] [INFO] Remove debug/release signing properties
[2020-02-06T09:35:08.401Z] [INFO] Zipping application source...
[2020-02-06T09:35:33.191Z] [INFO] Application was not successfully generated!
[2020-02-06T09:35:33.194Z] [INFO] Execution time: 111922ms
 


Hello Swapnil, 

Have you downloaded firebase's configuration files and placed them inside the "www" folder ? 

You can't use this plugin directly from TruewindIT's github repository, because I think you have to customize some files before you can install the plugin. I'm pretty sure that's your problem.

João Domingos wrote:

Hello Swapnil, 

Have you downloaded firebase's configuration files and placed them inside the "www" folder ? 

You can't use this plugin directly from TruewindIT's github repository, because I think you have to customize some files before you can install the plugin. I'm pretty sure that's your problem.

Hi João Domingos

Thank you for reply!

I have downloaded both google service JSON and PList from firebase and add into resource as zip file.

It's working fine for dev and tst environment but not for production. 


Hi all,

Waiting for suggestion...!