# SearchAllAssets in Android Crashes

**URL:** <https://forums.unrealengine.com/t/searchallassets-in-android-crashes/1858145>\
**Category:** Programming & Scripting\
**Tags:** Android-Packaging, unreal-engine, question\
**Created:** [May 16, 2024, 3:24am UTC](https://forums.unrealengine.com/t/searchallassets-in-android-crashes/1858145 "2024-05-16T03:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moris0712](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Moris0712](https://forums.unrealengine.com/u/Moris0712)\
**Post date:** [May 16, 2024, 3:24am UTC](https://forums.unrealengine.com/t/searchallassets-in-android-crashes/1858145/1 "2024-05-16T03:24:00Z")

</div>

After mounting the chunk data, if you run SearchAllAssets(true) in AssetRegistry, the assets existing in the chunk data are also imported in Windows.

However, on mobile, if you run that statement, it crashes.

```auto
  TFunction<void(bool bSuccess)> LoadingModeCompleteCallback = [&](bool bSuccess)
  {
      OnLoadingModeComplete(bSuccess);
  };
  Downloader->BeginLoadingMode(LoadingModeCompleteCallback);

void UPatchingSubsystem::OnLoadingModeComplete(bool bSuccess)
{

    if (bSuccess)
    {
        AssetManager.GetAssetRegistry().SearchAllAssets(true);
    }
}

```

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/0/cf0f17593d144c6afb1d2fa1a9db72088503cb14.jpeg)

The file path refers to a saved map, but it is passed without adding / at the end, and this seems to be the problem.

Do you know how to solve this problem?

---

<div class="post-metadata">

**Author:** ![Moris0712](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Moris0712](https://forums.unrealengine.com/u/Moris0712)\
**Post date:** [May 20, 2024, 5:28am UTC](https://forums.unrealengine.com/t/searchallassets-in-android-crashes/1858145/2 "2024-05-20T05:28:59Z")

</div>

It seems like an engine bug, but it was not resolved as of 5.4.1, so AndroidPlatformFile.cpp was modified as follows.

```auto
int64 GetEntryLength(const FString & Path)
{
	const FString& Dir = Path + TEXT("/");
	if (Entries.Contains(Path))
	{
		TSharedPtr<FFileHandleAndroid>& File = Entries[Path]->File;
		return File != nullptr ? File->Size() : 0;
	}
	else if (Entries.Contains(Dir))
	{
		TSharedPtr<FFileHandleAndroid>& File = Entries[Dir]->File;
		return File != nullptr ? File->Size() : 0;
	}
	else
	{
		return 0;
	}
	TSharedPtr<FFileHandleAndroid>& File = Entries[Path]->File;
	return File != nullptr ? File->Size() : 0;
}

```
