[Solved] Appium Error: spawn UNKNOWN

Hello,
I am new to Appium. I am trying to do some automation on Firefox (windows 11) with Gecko, but Appium shows the error below. I have tried using administrator mode, disable anti-virus and changed registry. I have installed the Gecko bin file and added it to the path. Not sure what’s the next step to do. Thanks in advance!

Below is the CMD log:

Blockquote[AppiumDriver@cf05] Event ‘newSessionRequested’ logged at 1717923420574 (18:57:00 GMT+1000 (Australian Eastern Standard Time))
[Appium] Attempting to find matching driver for automationName ‘Gecko’ and platformName ‘windows’
[Appium] The ‘gecko’ driver was installed and matched caps.
[Appium] Will require it at C:\Users\Giami.appium\node_modules\appium-geckodriver
[Appium] Requiring driver at C:\Users\Giami.appium\node_modules\appium-geckodriver\build\index.js
[AppiumDriver@cf05] Appium v2.9.0 creating new GeckoDriver (v1.3.6) session
[AppiumDriver@cf05] Checking BaseDriver versions for Appium and GeckoDriver
[AppiumDriver@cf05] Appium’s BaseDriver version is 9.9.0
[AppiumDriver@cf05] GeckoDriver’s BaseDriver version is 9.9.0
[GeckoDriver@4d1c] Creating session with W3C capabilities: {
[GeckoDriver@4d1c] “alwaysMatch”: {
[GeckoDriver@4d1c] “browserName”: “firefox”,
[GeckoDriver@4d1c] “platformName”: “windows”,
[GeckoDriver@4d1c] “browserVersion”: “126.0.1”,
[GeckoDriver@4d1c] “appium:automationName”: “Gecko”
[GeckoDriver@4d1c] },
[GeckoDriver@4d1c] “firstMatch”: [
[GeckoDriver@4d1c] {}
[GeckoDriver@4d1c] ]
[GeckoDriver@4d1c] }
[GeckoDriver@4d1c (1a09c3c2)] Session created with session id: 1a09c3c2-2741-4ad6-afce-1acdbaae69c9
[GeckoDriver@4d1c (1a09c3c2)] Starting ‘D:\Learning\My Project\software\misc\gecko-bin\geckodriver.exe’ with args [“-p”,“5200”]
[GeckoDriver@4d1c (1a09c3c2)] Ending Gecko Driver session
[GeckoDriver@4d1c (1a09c3c2)] Gecko Driver session cannot be stopped, because the server is not running
[AppiumDriver@cf05] Event ‘newSessionStarted’ logged at 1717923420619 (18:57:00 GMT+1000 (Australian Eastern Standard Time))
[AppiumDriver@cf05] Encountered internal error running command: Error: spawn UNKNOWN
[AppiumDriver@cf05] at ChildProcess.spawn (node:internal/child_process:421:11)
[AppiumDriver@cf05] at spawn (node:child_process:761:9)
[AppiumDriver@cf05] at C:\Users\Giami.appium\node_modules\appium-geckodriver\node_modules\teen_process\lib\subprocess.js:143:24
[AppiumDriver@cf05] at Promise._execute (C:\Users\Giami.appium\node_modules\appium-geckodriver\node_modules\bluebird\js\release\debuggability.js:384:9)
[AppiumDriver@cf05] at Promise._resolveFromExecutor (C:\Users\Giami.appium\node_modules\appium-geckodriver\node_modules\bluebird\js\release\promise.js:518:18)
[AppiumDriver@cf05] at new Promise (C:\Users\Giami.appium\node_modules\appium-geckodriver\node_modules\bluebird\js\release\promise.js:103:10)
[AppiumDriver@cf05] at SubProcess.start (C:\Users\Giami.appium\node_modules\appium-geckodriver\node_modules\teen_process\lib\subprocess.js:141:18)
[AppiumDriver@cf05] at GeckoDriverProcess.init (C:\Users\Giami.appium\node_modules\appium-geckodriver\lib\gecko.js:136:21)
[AppiumDriver@cf05] at GeckoDriverServer.start (C:\Users\Giami.appium\node_modules\appium-geckodriver\lib\gecko.js:180:5)
[AppiumDriver@cf05] at GeckoDriver.createSession (C:\Users\Giami.appium\node_modules\appium-geckodriver\lib\driver.js:65:7)
[AppiumDriver@cf05] at AppiumDriver.createSession (C:\Users\Giami\AppData\Roaming\npm\node_modules\appium\lib\appium.js:731:35)
[HTTP] ← POST /session 500 52 ms - 592

[GeckoDriver@4d1c (1a09c3c2)] Starting ‘D:\Learning\My Project\software\misc\gecko-bin\geckodriver.exe’ with args [“-p”,“5200”]

have you tried to run the driver executable manually with the above parameters?

that’s a good suggestion. I tried it and realised I got the wrong Gecko driver for another OS, silly me. Thanks