godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.99k stars 21.16k forks source link

Notarization for MacOS export under Windows in Godot 4.2. Failed with "invalid number at line 1 column 2" #85684

Open diegopau opened 11 months ago

diegopau commented 11 months ago

Godot version

4.2.stable

System information

Godot v4.2.stable - Windows 10.0.19045 - GLES3 (Compatibility) - AMD Radeon RX 6700 XT (Advanced Micro Devices, Inc.; 31.0.22023.1014) - 13th Gen Intel(R) Core(TM) i7-13700KF (24 Threads)

Issue description

I am exporting a project for MacOS. I am in the "If you have an Apple Developer ID Certificate and exporting from Linux or Windows" case, as documented here and I followed all the steps. Everything seems to be filled up on my end and the code signing step is working.

The notarization fails with a message saying "invalid number at line 1 column 2". It would help a lot to know exact what that line and column reference to, but I wasn't able to find more logs about this. If I try to find my editor logs in "C:\Users{user}\AppData\Roaming\Godot\app_userdata{project}\logs I see that the godot.log wasn't updated with any new information related to my exporting attempts.

The documentation also says "You can use the rcodesign notary-log command to check notarization status." but if I do this I get an error "the following required arguments were not provided: " and since Godot handles the notarization internally, i don't know what the SUBMISSION_ID is or what exact command Godot used for rcodesign so I can replicate it outside Godot.

Monosnap (_) sofa-ob00005 tscn - seapod - Godot En Monosnap Project Export 2023-12-02 21 22 58 2 1 Monosnap logs 2023-12-02 21 24 08

Steps to reproduce

Follow the instructions here and then export for MacOS using the settings provided in my screenshots. An error shows saying that the notarization failed.

Minimal reproduction project

I tried with a totally empty project, with just a label on it and I input the same export information. The result was the same. I cannot drop my project here since the export settings contain sensitive data and passwords.

bruvzg commented 11 months ago

The notarization fails with a message saying "invalid number at line 1 column 2".

This is the error text returned by rcodesign, most likely it's some issue with API Key JSON file.

If I try to find my editor logs in

see editor log refer to the editor Output window you are already looking at, there are no additional logs.

The documentation also says "You can use the rcodesign notary-log command to check notarization status."

If a notarization request is successfully submitted, it will print SUBMISSION_ID in the editor Output window and show it in the export results window, it should look something like:

Notarization request UUID: XXXXXXXXXXXXXX
The notarization process generally takes less than an hour.
    You can check progress manually by opening a Terminal and running the following command:;
        "rcodesign notary-log --api-issuer <api uuid> --api-key <api key> <request uuid>"
    Run the following command to staple the notarization ticket to the exported application (optional):
        "rcodesign staple <app path>"
diegopau commented 11 months ago

@bruvzg Thanks for the reply! When you say that is most likely an issue with the API Key JSON file, do you mean the .p8 file that you specify in the "API Key" field of the Godot Export options? or maybe is a Json file that Godot passes internally to rcodesign with all the settings of the "Notarization" section of the export screen?

I am trying to determine if this is an error on my side or in Godot's side? I checked all the data there, including the .p8 file, and it all looks good. The .p8, if I open it with a text editor, shows the private key (it has been downloaded directly from the App Store Connect)

image image

districtjackson commented 8 months ago

Any updates on this? I am running into the same bug.

ostwilkens commented 1 month ago

It seems rcodesign expects a json file, not the p8 file. Generating the json file is described here: https://github.com/indygreg/apple-platform-rs/blob/634c7418151da01d3a3cc7081e63d6ea49a67f5e/apple-codesign/docs/apple_codesign_getting_started.rst#L110