2

I am setting up a Firebase Dynamic Links using App Links for a website that is also hosted in Firebase Hosting. I need to upload a .well-known/assetlinks.json to my Firebase Hosting website.

I am working on Mac, and if I try to create the .well-known folder on my Mac's drive it says: enter image description here

This makes it for me impossible to create, and then of course also upload the assetlinks.json (using the Firebase CLI which is the only tool that allows you to publish files to Firebase Hosting).

How can I install the required .well-known/assetlinks.json on my Firebase Hosting?

HixField
  • 3,538
  • 1
  • 28
  • 54
  • Possible duplicate of [Mac OS X doesn't allow to name files starting with a dot. How do I name the .htaccess file?](https://stackoverflow.com/questions/5891365/mac-os-x-doesnt-allow-to-name-files-starting-with-a-dot-how-do-i-name-the-hta) – abraham Aug 11 '19 at 15:13
  • Make the folder with the terminal instead of finder. – abraham Aug 11 '19 at 15:13

1 Answers1

3

I found the following work-around:

(1) Create a well-known/assetlinks.json locally => notice its without the . at the beginning which made it impossible on my Mac to create this folder originally

(2) Update the firebase.json file to add a rewrite rule :

"rewrites": [
          ...
          {
            "source": "/.well-known/assetlinks.json",
            "destination": "/well-known/assetlinks.json"
          },
          ...
        ],

(3) Publish to firebase hosting

Its not an ideal solution, but it works...

abraham
  • 46,583
  • 10
  • 100
  • 152
HixField
  • 3,538
  • 1
  • 28
  • 54
  • 4
    Note that you could also create a folder with a "." at the beginning if you do it from the terminal using "mkdir .well-known". The "." at the beginning makes the folder hidden by default. It gets listed only if you ask for all hidden files to be shown or use "ls -a" – Sanket_Diwale Apr 29 '20 at 09:34
  • I am using react to host site on firebase , I simply created a well-known folder manually with assets.json file and used firebase deploy hosting target:mysitename, it worked. – Amit Bravo Jul 30 '21 at 14:00
  • rewrite path not working – NISHANK KUMAR Apr 09 '22 at 10:12
  • Works in validator as well ! Thank you for this nice workaround https://developers.google.com/digital-asset-links/tools/generator – Nikola Markovic Oct 04 '22 at 10:40
  • The issue is actually "**/.*", Specify wich files you want to ignore and leave well-known – Ivan Krupik Feb 01 '23 at 06:12