UE4 오류 로그 # VS프로젝트 생성 오류

김진우·2022년 6월 29일
0

오류로그_UE4

목록 보기
1/5

원문

원글 링크
I use Git and two computers. I use the branch 4.27-plus on my desktop and the branch 4.27.2-release on my laptop. I created my project on my desktop and download it into my laptop. But i can't open or build my project. The UE4 show me the message below with Yes/No buttons.

Missing fps Modules
The following modules are missing or built with a different engine version:
   fps
Would you like to rebuild them now?

I tried but it couldn't be compiled.

fps could not be compiled. Try rebuilding from source manually

So, i tried Generate Visual Studio Project files. Of course i do Switch Unreal Engine version. It show me the same error message

Running C:/Users/frfr1/Desktop/git/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="C:/Users/frfr1/Desktop/git/UE4Study-NetworkFPS/fps.uproject" -game -engine -progress -log="C:\Users\frfr1\Desktop\git\UE4Study-NetworkFPS/Saved/Logs/UnrealVersionSelector-Win64-Shipping-2022.06.29-14.21.24.log"
Discovering modules, targets and source code for project...
ERROR: Expecting to find a type to be declared in a target rules named 'fpsTarget'.  This type must derive from the 'TargetRules' type defined by Unreal Build Tool.

Here is the log file.

.
.
.
UnrealBuildTool.Main: ERROR: Expecting to find a type to be declared in a target rules named 'fpsTarget'.  This type must derive from the 'TargetRules' type defined by Unreal Build Tool.
UnrealBuildTool.Main: BuildException: Expecting to find a type to be declared in a target rules named 'fpsTarget'.  This type must derive from the 'TargetRules' type defined by Unreal Build Tool.
UnrealBuildTool.Main:    위치: UnrealBuildTool.RulesAssembly.CreateTargetRulesInstance(String TypeName, TargetInfo TargetInfo) 파일 C:\Users\frfr1\Desktop\git\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:줄 514
UnrealBuildTool.Main:    위치: UnrealBuildTool.RulesAssembly.CreateTargetRules(String TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, String Architecture, FileReference ProjectFile, CommandLineArguments Arguments) 파일 C:\Users\frfr1\Desktop\git\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:줄 659
UnrealBuildTool.Main:    위치: UnrealBuildTool.ProjectFileGenerator.AddProjectsForAllTargets(PlatformProjectGeneratorCollection PlatformProjectGenerators, List`1 AllGames, List`1 AllTargetFiles, String[] Arguments, ProjectFile& EngineProject, ProjectFile& EnterpriseProject, List`1& GameProjects, Dictionary`2& ProgramProjects) 파일 C:\Users\frfr1\Desktop\git\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:줄 2339
UnrealBuildTool.Main:    위치: UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments) 파일 C:\Users\frfr1\Desktop\git\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:줄 774
UnrealBuildTool.Main:    위치: UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments) 파일 C:\Users\frfr1\Desktop\git\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:줄 208
UnrealBuildTool.Main:    위치: UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) 파일 C:\Users\frfr1\Desktop\git\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:줄 557
.
.
. 
/*
파일 = file
위치 = location
줄 = line
*/

How can i generate Visual studio project files and rebuild them to update version of UE4 project.

VS 프로젝트 생성 오류

요약

여러 환경에서 개발을 진행하는 중 발생한 이슈에 대해 내가 작성한 질문글이다.
요약하자면 엔진의 버전과 환경이 다를 때 비주얼 스튜디오 프로젝트가 생성이 되지 않는 문제에 대한 질문이다.

설명

UE4에서는 VS 프로젝트 파일을 자동으로 생성하는 기능이 있다. 이 기능 덕분에 불필요한 프로젝트 파일을 소스 컨트롤 레포지토리에 업로드하지 않아도 여러 환경에서 동일한 프로젝트 환경을 보장할 수 있다. 하지만 때로는 여러 원인으로 프로젝트 파일을 자동생성하지 못해 문제가 생기기도 한다.

키워드가 되는 오류 메시지는 이것이다.
Error: Expecting to find a type to be declared in a target rules named '*'
프로젝트를 생성하려고 시도하면 나타나는 이 메시지는 UE의 빌드를 담당하는 C#코드에서 파일명과 클래스명이 일치하지 않을 때 출력된다.

{projectRoot}/Source 경로에 위치한 *.Target.cs 파일들은 C++ 소스코드 빌드에 관여한다. 보통 아래와 비슷한 구조로 이루어져있다.

Fps.Target.cs
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class FpsTarget : TargetRules
{
	public FpsTarget( TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		ExtraModuleNames.AddRange( new string[] { "FPS" } );
	}
}

파일명.Target.cs 파일에 존재하는 클래스의 이름은 반드시 파일명Target로 되어있어야 한다. 이 규칙이 적용되지 않았을 때 위에서 언급한 에러 메시지가 출력되며 프로젝트 파일이 생성되지 않는 것이다

해결 방법

해결 방법은 간단하다. 클래스 이름과 파일 이름을 동일하게 해주면 해결된다. 나같은 경우 파일 이름은 fps.Target.cs이었지만 클래스 이름이 FpsTarget로 되어있었기 때문에 문제가 발생했던 것이다.

profile
게임 개발자입니다.

0개의 댓글