Nativized Function is Crashing the Mobile Game: Assertion Failed

  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.

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.

SalihBalkan,

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

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.

Sure, project is here: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

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!

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

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

Virustotal says it’s clear:

I uploaded the same file to dropbox and now it is downloading without warning: Dropbox - File Deleted

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.

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 Nexus 5 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?

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.

SalihBalkan,

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

Thanks,
Samantha