Can't compile a blank project on M1 chip Macbook

Hello! I have the latest version of XCode and latest version of UE.

I create a blank project with UE4.26, the project opens fine and works (aside from weird colors, things are green, red, blue and stuff like that, but I imagine that being a shader issue)

After closing the project I open the XCode workspace. I try to build that, but I get an error.

Running bundled mono, version: Mono JIT compiler version 5.16.0.220 (2018-06/bb3ae37d71a Fri Nov 16 17:12:11 EST 2018)
Processing build for Target=MyProject2Editor Platform=Mac Configuration=Development -architecture=arm64 /Users/eugenio.delvecchio/Documents/Unreal Projects/MyProject2/MyProject2.uproject 
Creating makefile for ShaderCompileWorker (no existing makefile)
ERROR: Couldn't find target rules file for target 'ShaderCompileWorker' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
       Location: /Users/Shared/Epic Games/UE_4.26/Engine/Intermediate/Build/BuildRules/UE4Rules.dll
       Target rules found:
Running Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject2Editor Mac Development /Users/eugenio.delvecchio/Documents/Unreal Projects/MyProject2/MyProject2.uproject -architecture=arm64
Building MyProject2Editor...
Performing 7 actions (5 in parallel)
[1/7] Compile SharedPCH.Engine.ShadowErrors.h
In file included from /Users/eugenio.delvecchio/Documents/Unreal Projects/MyProject2/Intermediate/Build/Mac/arm64/MyProject2Editor/Development/Engine/SharedPCH.Engine.ShadowErrors.h:281:
In file included from /Users/Shared/Epic Games/UE_4.26/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:322:
/Users/Shared/Epic Games/UE_4.26/Engine/Source/Runtime/InputCore/Classes/InputCoreTypes.h:10:10: fatal error: 'InputCoreTypes.generated.h' file not found
#include "InputCoreTypes.generated.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command ExternalBuildToolExecution failed with a nonzero exit code

This is the build.cs

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class MyProject2 : ModuleRules
{
	public MyProject2(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

		PrivateDependencyModuleNames.AddRange(new string[] {  });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
	}
}

I Was Able To Solve This Problem By Changing The Build Target From “Apple Silicon (M1)” To “Rosetta” In XCode