"null object reference" error windows target

Greetings. I have an openfl/away3d project (similar to the Basic3DSLoader example) that compiles successfully in flash or html5. I’m trying to target windows now. The window opens and I see my preloader, but then I get a little box pops up with “Null Object Reference”; clicking OK crashes the application. I’ve tried different versions of Visual Studio Community (2019, 2015, currently 2017) and I’m using hxcpp 4.0.19 and the latest openfl, haxe, etc. Any ideas as to what would trigger this? Thank you in advance.

Called from hxcpp::__hxcpp_main
Called from ApplicationMain::main ApplicationMain.hx line 25
Called from ApplicationMain::create ApplicationMain.hx line 130
Called from lime.app.Application::exec lime/app/Application.hx line 150
Called from lime._internal.backend.native.NativeApplication::exec lime/_internal/backend/native/NativeApplication.hx line 146
Called from lime._internal.backend.native.NativeApplication::handleRenderEvent lime/_internal/backend/native/NativeApplication.hx line 370
Called from lime.app._Event_lime_graphics_RenderContext_Void::dispatch lime/_internal/macros/EventMacro.hx line 91
Called from openfl.display.Stage::__onLimeRender openfl/display/Stage.hx line 1955
Called from openfl._internal.renderer.context3D.Context3DRenderer::__render openfl/_internal/renderer/context3D/Context3DRenderer.hx line 857
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObject openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1001
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObjectContainer openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1070
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObject openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1001
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObjectContainer openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1070
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObject openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1001
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObjectContainer openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1070
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObject openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1001
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObjectContainer openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1070
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObject openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1001
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObjectContainer openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1070
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderDisplayObject openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1003
Called from openfl._internal.renderer.context3D.Context3DRenderer::__renderShape openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1185
Called from openfl._internal.renderer.context3D.Context3DRenderer::__updateCacheBitmap openfl/_internal/renderer/context3D/Context3DRenderer.hx line 1420

I found this topic: https://github.com/openfl/openfl/commit/d197b434bfcd74889063cc3b9f9eeef8b2cb7bc9

I went back to openfl version 8.9.2 and changed haxe\lib\openfl\8,9,2\src\openfl_internal\renderer\context3D\Context3DRenderer.hx line 1183 to:
private function __renderShape(shape:DisplayObject):Void

My project is now working!!!

This is fixed in the latest release… sorry for the trouble :sweat_smile:

I tried 8.9.4 and got the following:

Called from openfl/_internal/renderer/context3D/Context3DGraphics.hx line 34
Called from openfl/display/BitmapData.hx line 130
Called from openfl/display/BitmapData.hx line 294
Called from lime/graphics/Image.hx line 548
Called from lime/_internal/graphics/ImageDataUtil.hx line 526
Called from /usr/share/haxe/std/neko/Lib.hx line 42
Uncaught exception - load.c(237) : Failed to load library : C:\HaxeToolkit\haxe\lib\lime/7,6,1/src/…/ndll/Windows64/lime.ndll
Error: Could not process asset libraries (swf, swf, swf, swf, swf)

Oh yeah we’re having trouble with Windows + Haxe 3.4 at the moment – I’m going to look into this soon

Haxe 4 RC4 moved Windows from 32-bit Neko to 64-bit and 8.9.4 includes a fix for it :confused:

You could also try 8.9.3 for now

1 Like

ok, thank you. I appreciate all you’re doing!