My fixes for "Unable to patch action graph" and "version ("1.2") not supported"

I initially had some issues when trying to compile my C++ code in VS Code on Windows (11) using VS 2022. I was able to resolve them for my own setup and figured I would share my solutions in case anyone else runs into similar issues.

I also found that moving my UE project to my SSD made compilation much faster than having it on my external HD.

When recompiling using Live Coding, I kept getting the error:
Unable to patch action graph - unexpected executable in compile action (C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe)

Based on suggestions here:

what worked for me was to change the editor in UE5 from VS Code to VS 2022, re-create the C++ class for VS2022 which creates a *.sln, open the *.sln in VS2022, and run UE from debug mode in VS2022 (e.g., click the “Local Windows Debugger” button with the green arrow in VS2022).

This resolved the “Unable to patch action graph” error but I was then getting the error (whether compiling in VS2022 or in UE Live Coding):
ERROR: Unhandled exception: Dependency file some_json_file.json version (“1.2”) is not supported version

I wrote a python script (see below) to manually hack all the json files to be version 1.1 instead of 1.2.

After editing any source code, but before recompiling (either in VS2022 or using Live Coding), I always run the attached fix_json.py from my <project_root>/Intermediate/Build/Win64 directory.

My python script (I called it fix_json.py):

import os, fnmatch
def findReplace(directory, find, replace, filePattern):
    for path, dirs, files in os.walk(os.path.abspath(directory)):
        for filename in fnmatch.filter(files, filePattern):
            filepath = os.path.join(path, filename)
            print(filepath)
            with open(filepath) as f:
                s = f.read()
            s = s.replace(find, replace)
            with open(filepath, "w") as f:
                f.write(s)

findReplace(".", "Version\": \"1.2", "Version\": \"1.1", "*.json")

Privacy & Terms