# Nativized Function is Crashing the Mobile Game: Assertion Failed

**URL:** <https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186>\
**Category:** Mobile\
**Tags:** assertion-failed, function-library, unreal-engine, crash, Blueprint, question\
**Created:** [October 1, 2016, 10:25pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186 "2016-10-01T22:25:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 1, 2016, 10:25pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/1 "2016-10-01T22:25:44Z")

</div>

1. Create a function library
2. Create a very simple function with a “Switch by int” and Return nodes that return asset references, as you see below.
3. Use it’s output from a blueprint
4. Test it in editor, it will work perfectly
5. Package it without nativizing assets, again it will work fine.
6. Package with “Nativize Assets” enabled. It will crash when we call that function in the phone.

In the monitor.bat, it is giving this error:

```
10-02 01:18:11.683: D/UE4(17252): Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:Runtime/Core/Public/Containers\Array.h] [Line: 804] 
 10-02 01:18:11.683: D/UE4(17252): Array index out of bounds: 2 from an array of size 0libUE4.so!FDebug::LogAssertFailedMessage(char const*, char const*, int, wchar_t const*, ...) 

```

As far as I found out, array index 2 is came from this line in the nativized .cpp file:

UMyFunctionLibrary\_C\_\_pf398527342::StaticClass())-\>UsedAssets[2]

Here is an empty project that you can reproduce this issue: [Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.](https://1drv.ms/u/s!AuWmEEQoVAOmnyCRMpPT7j83_cG9)

```
10-02 01:18:11.645: D/UE4(17252): [2016.10.01-22.18.11:645][-6980444]LogBlueprintUserMessages: [MeshSwitcherWidget_C_0] Found the actor with given tag! Now I will set it to the mesh that I took from function...
10-02 01:18:11.649: D/UE4(17252): [2016.10.01-22.18.11:649][-6980444]LogOutputDevice:Warning: 
10-02 01:18:11.649: D/UE4(17252): Script Stack:
10-02 01:18:11.649: D/UE4(17252): MeshSwitcherWidget_C.BndEvt __ButtonCylinder_K2Node_ComponentBoundEvent_1_OnButtonClickedEvent__ DelegateSignature
10-02 01:18:11.683: D/UE4(17252): Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:Runtime/Core/Public/Containers\Array.h] [Line: 804] 
10-02 01:18:11.683: D/UE4(17252): Array index out of bounds: 2 from an array of size 0libUE4.so!FDebug::LogAssertFailedMessage(char const*, char const*, int, wchar_t const*, ...) 
10-02 01:18:11.683: D/UE4(17252): libUE4.so!UMyFunctionLibrary_C __pf398527342::bpf__ GetMesh__pf(int, UObject*, UStaticMesh*&) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!UMeshSwitcherWidget_C __pf398527342::bpf__ ExecuteUbergraph_MeshSwitcherWidget__pf_0(int) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!UFunction::Invoke(UObject*, FFrame&, void*) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!UObject::ProcessEvent(UFunction*, void*) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!void TMulticastScriptDelegate<FWeakObjectPtr>::ProcessMulticastDelegate<UObject>(void*) const 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!UButton::SlateHandleClicked() 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!TBaseUObjectMethodDelegateInstance<false, UButton, FReply ()>::Execute() const 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!SButton::OnMouseButtonUp(FGeometry const&, FPointerEvent const&) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!FSlateApplication::RoutePointerUpEvent(FWidgetPath&, FPointerEvent&) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!FSlateApplication::ProcessMouseButtonUpEvent(FPointerEvent&) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!FSlateApplication::OnTouchEnded(FVector2D const&, int, int) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!non-virtual thunk to FSlateApplication::OnTouchEnded(FVector2D const&, int, int) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!FAndroidInputInterface::SendControllerEvents() 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!FAndroidApplication::PollGameDeviceState(float) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!FEngineLoop::Tick() 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!AndroidMain(android_app*) 
10-02 01:18:11.684: D/UE4(17252): libUE4.so!android_main() 
10-02 01:18:11.684: D/UE4(17252): libUE4.so![Unknown]() 
10-02 01:18:11.686: D/UE4(17252): [2016.10.01-22.18.11:685][-6980444]Assertion failed: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:Runtime/Core/Public/Containers\Array.h] [Line: 804] 
10-02 01:18:11.686: D/UE4(17252): Array index out of bounds: 2 from an array of size 0
10-02 01:18:11.686: D/UE4(17252): [2016.10.01-22.18.11:686][-6980444]LogWindows: FAndroidMisc::RequestExit(1)
10-02 01:18:11.688: I/art(17252): System.exit called, status: 0
10-02 01:18:11.688: I/AndroidRuntime(17252): VM exiting with result code 0, cleanup skipped.

```

 ![109307-screenshot.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/0/1d0adf501f421d9b3f6fbabfe4fddb059524e0ad.jpeg)

 ![109308-callerwidget.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/c/cac1a3ec84138be8b91284a33d5f09ed8ebda9c3.jpeg)

 ![109309-guiltyfunctionlibrary.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/9/48905a66d369addefa7680467901e268ffa950a5.jpeg)

 ![109310-monitor_bat_log.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/2/a824d502fc5309f8afe51c8d5ea133a62795ab04.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a08c0bf2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a08c0bf2](https://forums.unrealengine.com/u/anonymous_user_a08c0bf2)\
**Post date:** [October 7, 2016, 6:34pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/2 "2016-10-07T18:34:01Z")

</div>

,

Thank you for your report, it looks as though this issue is already reported in [UE-35734][1].

[Unreal Engine Issues and Bug Tracker (UE-35734)](https://issues.unrealengine.com/issue/UE-35734)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 7, 2016, 8:04pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/3 "2016-10-07T20:04:35Z")

</div>

Yes, looks similar but I can successfully package the game. Crash occurs at runtime both in 4.12.5 and 4.13.1. UE-35734 is opened for version 4.13 too but it says that it doesn’t build at all.

As you see at my functions graph, it doesn’t include an open input. Or are these considered as open too, since it defines it’s variable by itself? But it is still not failing the packaging process.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a08c0bf2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a08c0bf2](https://forums.unrealengine.com/u/anonymous_user_a08c0bf2)\
**Post date:** [October 7, 2016, 9:03pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/4 "2016-10-07T21:03:05Z")

</div>

When testing my set up did not run into a crash like you’re describing however the issue does seem to come back down on nativize blueprint assets and functions like UE-35734.

If you’d like to provide me a zip to further research, I’ll be more than happy to accept it through a private message on the forums (or here if you don’t mind it being public).

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 7, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/5 "2016-10-07T21:19:40Z")

</div>

Sure, project is here: [Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.](https://1drv.ms/u/s!AuWmEEQoVAOmnyCRMpPT7j83_cG9)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a08c0bf2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a08c0bf2](https://forums.unrealengine.com/u/anonymous_user_a08c0bf2)\
**Post date:** [October 12, 2016, 8:19pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/6 "2016-10-12T20:19:29Z")

</div>

Your project is blocked for having viruses or spyware attached. None of my browsers allow the project to be downloaded.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 12, 2016, 10:33pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/7 "2016-10-12T22:33:21Z")

</div>

I had the same issue right now, but it even doesn’t download before giving this warning.

Virustotal says it’s clear:

> **[VirusTotal](https://www.virustotal.com/gui/file/4656cee34caa7cc4f17b9b8d8df08e1416c8289a946a64f2a52e06920a4e19fa/detection/f-4656cee34caa7cc4f17b9b8d8df08e1416c8289a946a64f2a52e06920a4e19fa-1476310966)**
>
> VirusTotal

I uploaded the same file to and now it is downloading without warning: [https://www](https://www)…com/s/vpmjycofph57g24/CrashTester.zip?dl=0

No DLL files or source codes exist in the project, but if you want to feel safe you can create same simple project by the BP pictures that I shared in the first post, of course.

Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a08c0bf2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a08c0bf2](https://forums.unrealengine.com/u/anonymous_user_a08c0bf2)\
**Post date:** [October 19, 2016, 8:27pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/8 "2016-10-19T20:27:58Z")

</div>

Thank you for providing me with links where I’m able to download your project. I have tested your project with nativized assets switched on and did not run into a crash on our or the Samsung Note 4.

- Please try to turn off your plugins and see if you can package and run the project without any trouble.
- Is this happening on all devices or specific devices?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 20, 2016, 5:21pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/9 "2016-10-20T17:21:11Z")

</div>

I disabled all downloaded plugins but problem is still occuring.

It crashes when I tap one of the buttons on both Zenfone 2 A501CG and _Samsung Galaxy Note 4_ SM-N910C. I am unable to try with another device for now.

I packaged in development mode, but results with shipping mode were same. Same game crashes on my Note 4, which deosn’t crash on yours. My computer is using Windows 10 with VS 2015 Community Edition. It is same with 4.12.5 and 4.13.1.

If you request, I can provide apk files too.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a08c0bf2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a08c0bf2](https://forums.unrealengine.com/u/anonymous_user_a08c0bf2)\
**Post date:** [October 25, 2016, 6:55pm UTC](https://forums.unrealengine.com/t/nativized-function-is-crashing-the-mobile-game-assertion-failed/372186/10 "2016-10-25T18:55:45Z")

</div>

,

I have entered UE-37778 as the issue for this assertion crash. Once approved for public , it should show up on our Issues site.

Thanks,
