Solving Sketch Cloud’s sync issue
This is a solution for a very specific problem I have encountered while working on a Design System on Sketch Cloud, hopefully it’ll help you too.
The issue
I’m currently leading the development of a Design System for my company, since it’s not a one-man project, we use Abstract to version control and allow for multi-collaboration. For distribution, we publish it to the Sketch Cloud and share it with everyone in the company.
The issue is when we publish the first version to Sketch Cloud, it was all ok. The linking between the sketch file on Abstract’s main branch and the project on Sketch file was still there… until after a few branching and merging, the link was just no longer there. When clicking on the top right “Sketch cloud” icon it became “Save to Workspace” instead to “Update document”.
Now, as I said this is a very specific case for us. But I do know sometimes it happens too if you duplicate the same Sketch file a couple times and something would just mess up the linkage between your file and the Cloud’s.
If you have this issue, I have a solution for you. It is a bit of a hack, but it works for me.
The solution
This might be a lesser known fact, but Sketch files are actually bunch of JSON files combined. Since Sketch 43, you can actually unzip a Sketch file to reveal all the JSON files that made it.
If you read the documentation provided by Sketch, one of the JSON file “user.json” contains the data that determines whether the file has been uploaded to Sketch Cloud.
Now that you understand how things work, all we have to do is to get the file on Sketch Cloud (because it contains the correct data in user.json) and replace it with the Sketch file you have that doesn’t link with the one on Sketch Cloud anymore.
Too confusing? Just follow these steps:
Step 1: Download the file from Sketch Cloud
Go to your Sketch Cloud project and download the file.
Step 2: Unzip the downloaded Sketch file
You can do so by simply renaming the Sketch file and change the format from “.sketch” to “.zip”. When prompted, click “Use .zip”. Then double click on the converted zip file, it will decompress everything and you’ll be able to see all the JSON files inside.
Step 3: Copy the “user.json” file
Step 4: Unzip your Sketch file
Repeat Step 2 but on the Sketch file that you’d like to link back to Sketch Cloud.
Step 5: Replace the “user.json” file
Now paste the “user.json” file you copied on Step 3 to the folder you unzipped on Step 4. When prompted if you’d like to replace the file, click yes.
Step 6: Zip your file and convert back to Sketch file
Selected all the files inside the folder, right click and select compressed. Once done, you’ll get a file named “Archive.zip”. Rename that file to “Archive.sketch”.
Anddd that’s it! Now open that “Archive.sketch”, click the top right Sketch Cloud icon you’ll see “Update document” now.
Hopefully this helps.