I created my xcframework on my Desktop called MyXCFramework.xcframework then I zipped it like Boris said in WWDC2020 about Distribute binary frameworks as Swift packages both files are on Desktop and I want to get my checksum, then I used this line of code in terminal:
cd ~/Desktop/
swift package compute-checksum ~/Desktop/MyXCFramework.xcframework.zip
But terminal through this error:
error: root manifest not found
How can I solve this error?
I do not know why terminal trying to reach to manifest in this point?! because there is no manifest yet! I need checksum to build my manifest for Distribute binary framework as Swift package. So How can I solve this issue?
After searching a lot and lots of trial and errors I found 2 ways to solve the issue:
To create the required checksum, open the Terminal app, navigate to the root of the package, and run swift package compute-checksum path/to/MyFramework.zip.
Way 1:
1 - It is important to mention that Apple says MyFramework.zip but in the fact it is MyXCFramework.zip
2 - Apple says: navigate to the root of the package it means the package that you are going to type and give checksum to! It is weird that the Folder or the Package is needed for reading checksum because checksum is the parameter for Package! I do not know what is happening under the hood but it is how it works.
Way 2:
You can give some dummy value as checksum to Package, then Xcode would through an error and give you the correct and needed checksum and also tell you the wrong checksum you used. Then you copy that error massage and strike the correct checksum and replace it instead of the dummy checksum. We are not done yet! As Xcode wouldn't have build the correct Package with new correct checksum, it would be in kind of a lockdown! You need to go to File in Xcode then Swift Package then click on Reset Package Caches. After that you are good to go! In this way you shortcut the Terminal way for reading checksum.
Here you are 2 way of finding checksum!