Godot: Cannot --export via command line in 3.1.1 (mono)

Created on 3 May 2019  路  10Comments  路  Source: godotengine/godot

Godot version: 3.1.1.stable.mono.official
OS/device including version: Windows 10

Issue description:
When trying to export a project via the command line, I get an error.

Command:

godot --path . --export win64 build/bin/win64/signfordelivery.exe --no-window

Output:

OpenGL ES 3.0 Renderer: Radeon RX 580 Series
Mono: Logfile is: C:\Users\Wouter\AppData\Roaming/Godot/mono/mono_logs/2019_05_03 13.33.45 (11436).txt
ERROR: instance: Class 'EditorSettings' can only be instantiated by editor.
   At: core/class_db.cpp:523
ERROR: poll: C:\Users/Wouter/AppData/Roaming/Godot/editor_settings-3.tres:3 - Parse Error: Can't create sub resource of type: EditorSettings
   At: scene/resources/resource_format_text.cpp:561
ERROR: load: Condition ' err != OK ' is true. returned: RES()
   At: core/io/resource_loader.cpp:208
ERROR: Failed loading resource: C:\Users/Wouter/AppData/Roaming/Godot/editor_settings-3.tres
   At: core/io/resource_loader.cpp:285
WARNING: create: Could not open config file.
     At: editor/editor_settings.cpp:871
ERROR: _fs_changed: Project export failed with error code 9.
   At: editor/editor_node.cpp:495
debugger-agent: Unable to listen on 4200

This happens with my game but also with a completely new, empty project in 3.1.1. The export command worked fine in 3.1.

Steps to reproduce:

  • Create a new (empty) project
  • Create an export template
  • Export it with the CLI command above
bug buildsystem mono

All 10 comments

--project . is not a valid argument. I think you mean --path ..

Oops, you're right. My build script does in fact use --path. I goofed when I wrote it here. Updated.

The same happens to me without using mono.
I am using the version of Godot distributed through Steam, so my paths in the error log are a little bit different. My editor version is 3.1.1.stable.official .
My OS is Xubuntu 18.04, Linux x86_64, kernel: 4.15.0-48-generic

I'm seeing a similar set of issues. I'm using Windows 10, trying to export via CLI on the Steam version of Godot.

My command line:
godot.windows.opt.tools.64.exe ..\project\project.godot --export "HTML5" ".\html5\"

When I run this, I get the following results:
OpenGL ES 3.0 Renderer: GeForce GTX 1080/PCIe/SSE2 ERROR: _fs_changed: Project export failed with error code 9. At: editor/editor_node.cpp:495

I'm not sure what is causing this issue.

On a side note, if I include --path in my command line, it actually creates a new project.godot, overwriting the old one and completely nuking my project settings - I have to discard my changes in VCS to get it back.

godot.windows.opt.tools.64.exe --path ..\project\project.godot --export "HTML5" ".\html 5\"

Thanks,
-Devin

Hi,

I spent more time playing around with this.
Regarding Project export failed with error code 9:
It looks like the folder has to exist before you can deploy to it. Try making the folder first. Once the export path existed I was no longer getting that error. I see no reason why Godot couldn't make that folder when running --export -- especially if it's going to give an ambiguous error code instead of any usable feedback.

Regarding --path:
Looks like when you exclude the --path option, it expects the actual project.godot file path. When you use --path in your command line, it instead wants the directory, not the filepath, to your project.

Therefore, it should be used like:
godot.windows.opt.tools.64.exe --path ..\project\ ...
OR
godot.windows.opt.tools.64.exe ..\project\project.godot

I feel this behavior is misleading and destructive... shouldn't they be changed to match? Personally I see no reason why both shouldn't require you point directly at the project.godot file...

Thanks,
-Devin

I've investigated further on this, and I'm getting really frustrated.

It looks like a few things:

  1. The path to the project.godot file/directory is relative to the current working directory

    1. This is the one thing that behaves like I'd expect 馃憤

  2. The output path for the export template must be specified

    1. Why is this necessary? The build templates already have their output locations specified

    2. export_presets.cfg has a export_path key for every build



      1. This is an absolute path?? This means it breaks on any machine that isn't using the exact same path


      2. Can this be a relative path, then I can ensure that I always know where the builds will go


      3. There's no reason the CLI can't still specify an override, of course



  3. The output path for the export template is relative to the project.godot directory

    1. Why am I suddenly changing context? Am I mistaken here?

    2. This makes it near impossible to create intuitive command line deployment scripts

  4. The target directory must already exist

    1. Since I want to export anyways, Godot should ensure directories exist



      1. At the very least this should be an option on the CLI



    2. Paired with the above point, I cannot simply create this directory via the same path provided to the export template (which shouldn't need the path in the first place unless overridden)



      1. I have to either make sure the directory is created ahead of time (not gonna happen on clean instances) or ensure that I create the dir using a different path than the one I'm passing to the export directory????



This has wasted a lot of my time and is quite frustrating, if not embarrassing, that Godot behaves this way (And does not provide feedback, have documentation. Maybe I'm completely missing the memo here?)

Either way, please try your export with my findings and confirm that it's the case or at least confirm I'm going insane :)

Thanks,
-Devin

I have the same exact issue, except the Godot version used is not mono:

Godot_v3.1.1.stable.official
Windows 10

Used command:

..\godot.exe --export "Linux\X11" .

Output:

OpenGL ES 2.0 Renderer: GeForce GTX 1050 Ti/PCIe/SSE2
ERROR: instance: Class 'EditorSettings' can only be instantiated by editor.
   At: core/class_db.cpp:523
ERROR: poll: C:\Users/Rokas/AppData/Roaming/Godot/editor_settings-3.tres:3 - Parse Error: Can't create sub resource of type: EditorSettings
   At: scene/resources/resource_format_text.cpp:561
ERROR: load: Condition ' err != OK ' is true. returned: RES()
   At: core/io/resource_loader.cpp:208
ERROR: Failed loading resource: C:\Users/Rokas/AppData/Roaming/Godot/editor_settings-3.tres
   At: core/io/resource_loader.cpp:285
WARNING: create: Could not open config file.
     At: editor/editor_settings.cpp:871
ERROR: _fs_changed: Project export failed with error code 9.
   At: editor/editor_node.cpp:495

@DevinPentecost I was having the same issue earlier today, and my independent investigation led to the same conclusions as yours--it would have saved me some time if I'd found your answer first!

Possibly related to #34148

Path should be relative to project file location.

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdetronquito picture ducdetronquito  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

Spooner picture Spooner  路  3Comments

gonzo191 picture gonzo191  路  3Comments

RebelliousX picture RebelliousX  路  3Comments