Reading from texture doesn't work in packaged build (5.1)

I’m trying to read pixel from UTexture2D and it works in the editor but in packaged build I’m getting a blank color and a bunch of errors. Here’s my code:

FTexture2DMipMap* Mip0 = &AreasMap->GetPlatformData()->Mips[0];
FByteBulkData* RawImageData = &Mip0->BulkData;
const FColor* PixelData = reinterpret_cast<const FColor*>(RawImageData->Lock(LOCK_READ_ONLY));

// Access the color from PixelData here

RawImageData->Unlock();

Here’s the error:

[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: === Handled ensure: ===
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error:
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: Ensure condition failed: !bIsInlined || BulkMeta.GetOffset() == INDEX_NONE || IgnoreInlineDataReloadEnsures.bEnabled [File:D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\BulkDataStreaming.cpp] [Line: 128]
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: Attempting to stream inline BulkData! This operation is not supported by the IoDispatcher and so will eventually stop working. The calling code should be fixed to retain the inline data in memory and re-use it rather than discard it and then try to reload from disk!
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: Stack:
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: [Callstack] 0x00007ff6b0662c74 ProximaUniverse.exe!UE::BulkData::Private::EnsureCanStreamBulkData()
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: [Callstack] 0x00007ff6b0682c0b ProximaUniverse.exe!UE::BulkData::Private::OpenReadBulkData()
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: [Callstack] 0x00007ff6b06a01cf ProximaUniverse.exe!FBulkData::TryLoadDataIntoMemory()
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: [Callstack] 0x00007ff6b0681456 ProximaUniverse.exe!FBulkData::MakeSureBulkDataIsLoaded()
[2022.12.15-20.14.36:330][328]LogOutputDevice: Error: [Callstack] 0x00007ff6b0680da5 ProximaUniverse.exe!FBulkData::Lock()

Additionally every time when the provided code is called I’m getting this:

[2022.12.15-20.14.37:040][328]LogFileManager: Error: Requested read of 67108864 bytes when 67108214 bytes remain (file=…/…/…/MyGame/Content/UI/Textures/Map/MyTex.uexp, size=67109024)

same issue here, have you find a solution?

You can draw a material with your target texture to a render target and then save it as an array. That’s how i did it in the end.

UKismetRenderingLibrary::DrawMaterialToRenderTarget(this, MyRenderTarget, MyMaterial);
TArray<FColor> PixelData;
UKismetRenderingLibrary::ReadRenderTarget(this, MyRenderTarget, PixelData);

I have the same issue but with pure blueprint project. The error happens when I try to add ARCandidateImage in the ARSession.

Somebody have an idea to resolve it ?

I explaine this in this topic : How to use "AR Session" and "Add Runtime Candidate Image" with Blueprint ?