[Firebase Mobile Sample] Error installing cordova-plugin-firebase': TypeError: Path must be a string

Forge Component
(3)
Published on 2019-07-17 by David Sousa
3 votes
Published on 2019-07-17 by David Sousa

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 and 6.0


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

- Why you are manually playing with JSON version, you can download the version compatible with your platform i.e MABS

- Try to use the MABS version 5.2 & rebuild.
- Check you FirebaseMobile Plugin version compatibility :

  • version 1.0.6 with MABS 5
  • version 1.0.7 with MABS 6


- If this didn't work then mention your MABS version
- The next time, better to upload logs by a file on POST.



Hope it helps.


Hi there, 

I was able to simulate the issue as well. 

I have contacted the component owner. 


Thanks,

Otávio Souza.

Hi,

From what I can read from the posted log and the error on service studio, the configuration files are missing from the app's resources.

Please follow the configuration guide in order to configure the app correctly.


David Sousa wrote:

Hi,

From what I can read from the posted log and the error on service studio, the configuration files are missing from the app's resources.

Please follow the configuration guide in order to configure the app correctly.



Hi David, thanks. 

I haven't setup correctly the "Target Directory" property. 

It's working as expected now. 


Swapnil,

Check it out if the issue isn't the same for you. 


Thanks,

Otavio Souza.

Hi Assif and David,

I have followed all steps as per mentioned doc and generate app on both MABS version 5.2 and 6.0.

But still I have facing the issue.

for reference, attach both logs and configuration setup screenshot.

Hi Swapnil,

We are also using firebase in our application we are able to receive notifications in android and we are not able to receive notifications in ios.,

For your query if you are using firebase mobile 1.0.6 then use MABS version 5.2.,

And from where you got logs please let us know so that it will be help full for us.


Thanks

Harish