godot icon indicating copy to clipboard operation
godot copied to clipboard

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

Open diegopau opened this issue 2 years ago • 4 comments

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: <SUBMISSION_ID>" 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.

diegopau avatar Dec 02 '23 20:12 diegopau

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>"

bruvzg avatar Dec 03 '23 21:12 bruvzg

@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

diegopau avatar Dec 04 '23 10:12 diegopau

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

jnarnold7 avatar Mar 02 '24 05:03 jnarnold7

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

ostwilkens avatar Oct 07 '24 22:10 ostwilkens

Thanks!

jnarnold7 avatar Nov 29 '24 02:11 jnarnold7

The Godot UI prompts for the p8 file, the API UUID (what Apple calls the Issuer UUID) and the API Key ID. Is this a change to the arguments that rcodesign accepts?

This is what works:

# create the json file
rcodesign encode-app-store-connect-api-key \
  -o ./app-store-connect-api-key.json \
  $ISSUER_UUID \
  $API_KEY_ID \
  $PATH_TO_P8_FILE
# actually notarize - submit, wait, staple
codesign notary-submit \
  --api-key-file ./app-store-connect-api-key.json \
  --staple \
  path/to/file/to/notarize

This apparently currently needs to be done outside Godot.

fdstevex avatar Apr 02 '25 11:04 fdstevex