Propagate config files script problem

Hi,

During chapter 1 you explain that using the propagate-config-files script is the easiest and fastest way to copy the IDE folder (.idea / .vscode) and the firebase config to the other directories so that the configuration is the same for each chapter and project.

However, the google-services.json file is copied to the android/app folder (as you explained and Google developer console suggested to put it here) but the script is looking in android/app/src folder.

Does it matter if it’s in the src folder? Will the app still run if it’s there? I’ve always had it in android/app folder so I had to modify the script slightly to get it to run successfully.

Just something that may need clearing up.
Thanks.

2 Likes

I did the same thing as you by changing “android/app/src” to just “android/app/”, I run the script and it prints “done” but it doesn’t seem to work.

1 Like

Hi,

There were two places I needed to make a change. On line 58 and 129, remove /src on both lines.

2 Likes

But did you make sure that the changes are reflected in the other starter and final folders?
Because I don’t see any changes in them.

I only updated the script in the first chapter folder, and all files were copied to all other chapters folders correctly.

What did you use to run the script?

I ran the script in the terminal sh propagate-config-files.sh

@paulio84 you’re completely right! Thanks for diagnosing this.
For fixing this issue, please open the propagate-config-files.sh file at the root folder.
Then, change line 58 to: WANTED_SUBFOLDER_3='android/app/google-services.json'
Finally, change line 129 to: "/google-services.json$"

This will be fixed in the second edition of the book thanks to you.

1 Like

You can try these few suggestions to fix the problem: Check the permissions of the remote servers. Make sure that you have the necessary permissions to access the remote servers and copy the files to the desired location. Verify the file path. Double-check that the file path is correct and that the files are located in the correct directory. Debug your script. Use debugging tools to identify where your script is failing. You can use print statements, logging, and debugging tools to help you diagnose the issue. Consider using a configuration management tool: If you are managing multiple servers, consider using a configuration management tool like Ansible or Puppet to automate the process of propagating config files. These tools are designed to manage the configuration of multiple servers and can save you time and effort. I hope these suggestions help you resolve your issue.
Productivity tracking program (description)

1 Like

If you get errors with running sh propagate-config-files.sh command (I got these on Ubuntu 23.04) try to run bash propagate-config-files.sh instead

1 Like