How to add a file to the root?



  • Plugins like Cordova-firebase request you to add a plist and json file to the root of the project.

    Monaca cloud does not allow to add to the root.

    Is there a way around this?

    Thanks
    Remco


  • Monaca

    There are a few ways to accomplish it because there are different firebase plugins.
    If you use https://github.com/fechanique/cordova-plugin-fcm then the files should be automatically created.
    If you use https://github.com/arnesson/cordova-plugin-firebase then you need to manually upload the config files in the root by following this procedure.

    1. Open your project in IDE.
    2. Click the upload button on the top-left of the page

    There are a few ways to accomplish it because there are different firebase plugins.
    If you use https://github.com/fechanique/cordova-plugin-fcm then the files should be automatically created.
    If you use https://github.com/arnesson/cordova-plugin-firebase then you need to manually upload the config files in the root by following this procedure.

    1. Open your project in IDE.

    2. Click the upload button on the top-left of the page

      0_1502075020322_Screen Shot 2017-08-07 at 11.57.59.png

    3. A modal will open, select the / as destination and upload the config files.

      0_1502075087809_Screen Shot 2017-08-07 at 11.58.07.png

    At this point, the config files should be available on IDE



  • Thanks! Great. I’ll try tonight.



  • I’ve not so much time now, but the files are not automatically created in the fcm plugin.

    i get this:

    Build Error: Error: Sandbox Exec Error: [ Error: cordova-plugin-fcm: You have installed platform android but file 'google-services.json' was not found in your Cordova project root folder.
    

    I think the plugin automatically puts them in the right place, once they are in the root folder.

    I also tried uploading a file. This might have worked since i got no error. Am i supposed to see it in the file structure? Or is it always hidden?


  • Monaca

    You should be able to see the files after your refresh the project tree content (there is an option close to the upload button.


Log in to reply