OpenCV plugin errors when deploying to android device (UE 5.0.3)

I’m currently deveolping a test app that will run an onnx format with images as inputand give me data on screen as output. I followed the steps on this tutorial (8) PyTorch Realtime Style Transfer model in Unreal Engine 5 with ONNX Runtime - YouTube .

However, when I want to deply the app to a compatible android device (I’ve already configured Android correctly in the project), I get the following error:

LogPlayLevel: Error: C:/Users/rodri/OneDrive/Documents/Unreal Projects/ONNXPrueba/Plugins/OpenCV/Source\ThirdParty/OpenCV/include/opencv2/opencv.hpp(48,10): fatal error: 'opencv2/opencv_modules.hpp' file not found

I’ve tried reinstalling UE5, wiping and reinstalling OpenCV externally (and wiping it again afterwards), but the error persists.

For reference, here is my Build file:

using UnrealBuildTool;

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

			new string[] 

And the relevant includes:

#include "PreOpenCVHeaders.h"
#include <OpenCVHelper.h>
#include <ThirdParty/OpenCV/include/opencv2/opencv.hpp>
#include <ThirdParty/OpenCV/include/opencv2/imgproc.hpp>
#include <ThirdParty/OpenCV/include/opencv2/highgui/highgui.hpp>
#include <ThirdParty/OpenCV/include/opencv2/core.hpp>
#include "PostOpenCVHeaders.h"

It seems that the error is in how UE is parsing the path of the OpenCV files inside the plugin, but I’m at a loss since I followed the exact steps of tht tutorial.

Any help would be appreciated. Thanks in advance.

Hello !

Did you figure out how to fix the issue ? Currently experiencing a similar issue except it is with another file : fatal error: ‘opencv2/core.hpp’ file not found.