godotengine / godot

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

[4.2] Editor hangs when starting projects (macOS) #85563

Open bejd opened 5 months ago

bejd commented 5 months ago

Godot version

v4.2.stable.official [46dc27791]

System information

macOS 14.1.2 (23B92), M1 Pro (ARM64)

Issue description

When trying to open and upgrade an existing (4.1) project, or start a new project, Godot hangs immediately after the Project Manager dialogue. I've left it running for ~10 minutes just in case, but nothing else happens. Only option is to force quit.

Window after selecting a project:

waiting for godot to start

Steps to reproduce

Minimal reproduction project

N/A

strangebirds commented 5 months ago

I am on Apple Silicon on Ventura 13.6.1 and also can't get Godot 4.2 to open. Hangs on the splash screen. I waited 6 minutes in case it was shader recompiling and nothing beyond the beachball. This happens with both new projects and old projects that need to be converted. (comment copied from #85616 (closed))

bruvzg commented 5 months ago

I can't reproduce this on M1 Mac.

Try opening the project for the terminal, to check for errors:

/Applications/Godot.app/Contents/MacOS/Godot --path /path/to/your/project --editor --verbose

Also try cleaning up Godot settings and caches:

strangebirds commented 5 months ago

Try opening the project for the terminal, to check for errors:

/Applications/Godot.app/Contents/MacOS/Godot --path /path/to/your/project --editor --verbose

Hangs after Shaders and Servers, on "Class 'EditorExportGDScript' is not exposed, skipping."

Also try cleaning up Godot settings and caches:

  • Remove content of ~/Library/Caches/Godot/ and ~/Library/Application Support/Godot/

Same result - hangs on existing or new projects after "Class xxx is not exposed, skipping' list.

  • If you are opening an existing project, remove the hidden .godot subfolder in the project folder as well.

So far, same result (3+ minutes, leaving it running for a bit longer to see if anything happens.)

Bjorkor commented 5 months ago
  • ~/Library/Caches/Godot/ and ~/Library/Application Support/Godot/

Here is the terminal output from your suggestion.

Screenshot 2023-12-01 at 10 46 10 AM

also, i don't have 'Godot' directories in /Library/Caches/ or /Library/Application Support/

bruvzg commented 5 months ago

Class 'EditorExportGDScript'

Are you using any plugins/add-ons in your project? Is it reproducible with the new and empty project?

Bjorkor commented 5 months ago

Class 'EditorExportGDScript'

Are you using any plugins/add-ons in your project? Is it reproducible with the new and empty project?

zero plugins, 100% fresh project

strangebirds commented 5 months ago

No plugins being used.

I tested previous 4.2 betas and I am able to open and use 4.2 beta 1, but no version after that opens (similar hangs as with 4.2.stable).

bejd commented 5 months ago

Try opening the project for the terminal, to check for errors:

/Applications/Godot.app/Contents/MacOS/Godot --path /path/to/your/project --editor --verbose

Hangs after Shaders and Servers, on "Class 'EditorExportGDScript' is not exposed, skipping."

Same results here. Also hangs at the same line after clearing the various caches, as suggested. I'm not using any plugins either.

I wondered if recent OS updates might have caused something weird, but I'm still able to open and create projects on Godot v4.1.3.

nopakos commented 5 months ago

Adding --rendering-method gl_compatibility worked for me. "mobile" did not work. "forward_plus" hanged the whole machine.

strangebirds commented 5 months ago

Ok. I feel like my Mac is messing with me now.

I tried testing a new user account (standard, not administrator) and installing Godot 4.2 there. It asked for Administrative privileges to install Apple software (unspecified). Godot 4.2 stable opened fine in the new user account. I logged out and into my regular account. 4.2 stable (Forward+) now opens without a hitch - both new projects and existing projects (started in 4.1).

Running Godot 4.2 verbose from the command line now does not give the block of 'Class xxx is not exposed, skipping' messages.

I don't know what changed, but other than the new user account there have been no other user-initiated changes (and I have my system download updates but not install them until I say). I did have a spontaneous reboot yesterday from a short power loss in my neighborhood. Maybe turning it off and back on again, ¯_(ツ)_/¯?

Let me know if I can provide more info to help others - I don't know what to look for, but am willing to try if anyone has any ideas.

bejd commented 5 months ago

Can confirm that strangebirds's workaround fixed 4.2 for me too: opening Godot 4.2 as a standard user account displayed an admin prompt, after entering credentials it ran fine. Now runs for my main admin account too.

Not sure if it's helpful but I nabbed a screenshot of the prompt:

Screenshot 2023-12-04 at 16 41 17

This reminded me: when I first opened 4.2 on my main account an admin prompt appeared on my Apple Watch. It didn't give any more info, so in case of malware I declined. During testing and uninstall/reinstalling, I got the notification again and allowed it, but the issue persisted.

bruvzg commented 5 months ago

Interesting find, the question is, what's invoking xcodebuild, it should not happen until project export.

But I guess it's the same issue as https://github.com/godotengine/godot/issues/85114 (https://github.com/godotengine/godot/pull/85168 was intended to fix, but I guess xcode-select might have different behavior depending on account type, maybe we should try detecting Xcode in some other way).

Bjorkor commented 5 months ago

I have ALSO been getting a prompt on my apple watch, with no identification, which I then dismissed. Very very interesting.

nopakos commented 5 months ago

I've got a voodoo-like trick working for me: Open the project normally, and as soon as I see the Godot splash-icon I press command-h (hide app), wait a little and click on the app icon to show the window again. I guess a racing condition is happening somewhere.

karlin commented 5 months ago

This happened to me too after a first-time install and making new "Mobile" project. When I turned on verbose, console was spewing the same message until I force-quit:

ERROR: Vulkan: Cannot submit graphics queue. Error code: VK_ERROR_DEVICE_LOST
    at: swap_buffers (drivers/vulkan/vulkan_context.cpp:2536)

I'm also using v4.2.stable.official.46dc27791 but on an Intel MacBook Pro running Sonoma 14.1.2 (23B92).

I worked around it by specifying --rendering-method gl_compatibility from the command line per the comment above by @nopakos. Now I can select any rendering engine and it seems to work fine, even if I relaunch normally and without specifying a rendering method.

vmarnauza commented 5 months ago

It seems that, in my case, the problem was caused by not having installed the latest Xcode command line tools after applying the latest major macOS update.

I launched Xcode and was prompted to install additional components and then, when Xcode was done with installing, I was able to launch Godot.

Garee commented 5 months ago

I was also encountering this issue and the comments here helped me find this workaround:

esvyridov commented 3 months ago

I installed Godot for the first time and encountered this issue after creating the initial project. Unfortunately, the steps mentioned in the previous message didn't work for me (xcode-select --install returned an error). However, the concept is accurate.

Here are the steps that resolved the issue for me:

1) Update Xcode via Software Update. 2) Open Xcode (it will download additional software). If Xcode gets stuck on "Installing additional components," restart your Mac and open Xcode again.

After completing these two steps, I was able to open the project.

Additionally, while having the frozen Godot window open, I noticed a few xcode... (I don't recall the full name) processes in Activity Monitor. Terminating these processes helped unfreeze the Godot window, and I was able to proceed to the next window with the scene. I'm not certain if this it's helpful, but I hope it might give someone a clue about the underlying problem.

alberbecois commented 2 months ago

Wanted to jump in and mention that I am also experiencing this issue. I'm on a Mac Studio 2022 with an M1 Max chip running MacOS Sonoma 14.2.1. I tried doing the console input as suggested in the comments and I'm getting first a warning

"WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:."

which according to Google is a security issue that needs to be reported to Godot. Then it tells me the path to the project is wrong, but I've double checked and used auto-complete in the terminal to be sure. I wanted to start learning Godot today so this is a bit of a bummer. Hopefully it will be resolved soon because I can't do anything with the engine in this state.

EDIT: the Xcode workaround also works for me. Once XCode has installed the additional components for development on MacOS then the editor opens.

phybros commented 1 month ago

+1 here. M1 macBook Pro on the very latest macOS Sonoma 14.4.1.

Some of my observations

I opened up XCode, and I needed to update some components. I tried to do that, and the Installing Additional Components dialog just went forever without doing anything. Then I rebooted as per @esvyridov then opened XCode, and this time it prompted for elevated privileges which I granted. It finished installing things and XCode finally opened. Then I closed XCode. Now all Godot versions work perfectly.


So to sum up:

  1. Close all Godots
  2. Open XCode, and install any components it needs (iOS SDK update etc) - reboot and try again if it just spins forever installing components
  3. Close XCode
  4. Everything in Godot should work now

So the issue must be something introduced in 4.2 which was then partially fixed in 4.3. Some reliance on "developer tools" on macOS (i.e. xcode-select --install)?

clayjohn commented 2 weeks ago

It sounds like the workaround is pretty clear now, users running into this can avoid the problem by updating XCode.

But its very weird that it happens in the first place. And the fact that it doesn't seem to happen with 4.1 points to something we do causing this.

@bruvzg Any ideas? Perhaps there is a way for us to provide compatiblity for people with out-of-date XCode versions so they don't run into this in the first place

circumlocutory commented 1 day ago

Possibly related: I started a 4.2.2 project on Windows 10, and today I tried pulling the proj to my intel mac for the first time. Editor appeared to load fine, but I could not run the scene. It would display the window, but with the Godot background, and would proceed to hang from there. After finding this issue thread, I updated Xcode and things are working fine now.