Error: load.c(357) : Primitive not found : [email protected]_zlib_decompress(2) / Error: Invalid field access : lastIndexOf

I have been stuck with ancient versions of haxe and openfl for a long time. Mostly because Haxe Flixel is not supporting OpenFL versions > 3.6.1 and Haxe > 3.2 having some issues that didn’t get fixed for a long time.

On my new system I decided to try to upgrade to the latest versions of everything. I was able to get the latest version of haxe to compile one of my javascript based projects after spending a few hours with updating code.

Then I moved over to the haxe flixel projects. First thing I did was setting up the android target for openfl. Everything went smooth. Time to try it on the project:

haxelib run openfl build android
Error: load.c(357) : Primitive not found : [email protected]_zlib_decompress(2)

Oh well, i might have setup android wrong. Let’s use neko instead:

haxelib run openfl build neko
Error: load.c(357) : Primitive not found : [email protected]_zlib_decompress(2)

This happens on a freshly installed windows 10 system. These are the haxelib versions:

haxelib list
actuate: [1.8.7]
closure: [0.1.4]
EnhanceOpenFLExtension: [dev:[…]\project\EnhanceOpenFLExtension]
extension-admob: [1.6.4]
extension-googleplayservices-basement: [1.1.0]
extension-iap: [1.2.2]
firetongue: [2.0.0]
flixel-addons: [2.5.0]
flixel-tools: [1.4.1]
flixel-ui: [2.2.0]
flixel: [4.3.0]
hxcpp: [3.4.64]
lime: [2.9.1]
mobile-detect-haxe: [0.0.1]
openfl: 3.6.1 [6.1.0]
phaser: [2.0.0]
swf: [2.3.1]
WebFont: [1.0.1]

I then tried to use

haxelib run openfl setup

to make sure i didn’t miss anything. That resulted in a non haxe flixel compatible openfl version which was fixed with

haxelib set openfl 3.6.1

The result:

project>haxelib run openfl build neko
Error: Invalid field access : lastIndexOf

Any hints on what that error refers to? Is there a way to get Haxe Flixel to work with the latest version of Haxe? Or should I return to using Haxe 3.2 which was the last version that worked for me so far?

If you want to use a release build of HaxeFlixel, then I believe OpenFL 3.6.1 is the latest they officially support. OpenFL 3.6.1 works with Haxe 3.2.1, but probably does not work properly with Haxe 3.4.2.

I have a development version of HaxeFlixel that I got running with OpenFL 6.1 here:

Current OpenFL releases are supported on Haxe 3.2.1 or Haxe 3.4.2, though Haxe 3.4.2 has intermittent compile issues depending on your system

In my experience, HaxeFlixel works fine with anything from Haxe 3.2.0 to the latest nightly builds, in combination with OpenFL 3.6.1 and Lime 2.9.1. That’s also what Flixel’s Travis is testing against.

Thank a lot, Gamma. Knowing that it should work, I tried another (old) project. And suddenly I got a new error message:

haxelib run openfl test neko
C:/HaxeToolkit/haxe/lib/flixel/4,3,0/flixel/system/macros/FlxDefines.hx:100: characters 51-55 : Please run ‘haxelib set lime 2.9.1’ (Flixel is currently incompatible with Lime 3.0.0 or newer).

Not sure why the error was different for the first project, but that’s as clear as it can get. After running the suggested command the old project started to compile using the neko target. I went back to the current project and it compiled, too - the “Invalid field access : lastIndexOf” error was gone.

First error seem to have been caused by me not running “openfl setup” even though that was stated in the setup instructions. The second error was related to the lime version. Not sure why HaxeFlixels lime version error message didn’t trigger on my current project, but I am glad that everything seems to be working now.

Thanks for the github link, Joshua. Didn’t find the time to try it yet, but surely will. It would be great if it would allow me to switch to a new OpenFL version - been hoping to be able to use some the new OpenFL 6 features for the backdrop of a game that I am working on.

Also thanks for the warning about 3.4.2. I assume you refer to https://github.com/HaxeFoundation/haxe/issues/5986 I did 10 “openfl test -clean windows” runs and they all finished without issues on my 4930K systen. Hopefully my system is not affected but i’ll keep it on my radar.

1 Like