2 days ago everything OK, now "build halted with errors."

Hi! I have been working on Haxe project, everything has been going smooth targeting windows… Until I took break for couple of days, coming back and now this happens I try to debug or release:

Building main
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -debug -Dfdb
Build halted with errors.
Done(1)

… I do not understand what is wrong, I have multiple times now reinstalled haxetoolkit, lime, openfl everything is up to date and not corrupted, I’ve tried HaxeDevelop and FlashDevelop, problem persists…

please, help… It is not my code, I have not done anything for couple of days and everything worked fine 2 days ago…

:frowning:

EDIT: I’ve managed to pinpoint source of problem I think. I tried to do new project from ground up, and when I edited my project.xml so that I could use .swf as my asset library, something goes wrong and it wont build… :I

Here is part of my project.xml:

    <!-- classpath, haxe libs -->
    <source path="src" />
    <haxelib name="openfl" />
    <haxelib name="swf" />
    <haxelib name="actuate" />
    
    <!-- assets -->
    <library path="Assets/library.swf" type="swf" preload="true" generate="true" />
    
    <assets path="Assets" rename="assets" exclude="openfl.svg|*.swf" />
    
    <icon path="assets/openfl.svg" />
    
    <!-- optimize output
    <haxeflag name="-dce full" /> -->

EDIT 2:
It’s got something to do with:

<library path="Assets/library.swf" type="swf" preload="true" generate="true" />

when I remove generate="true" and/or preload="true" I get:

Error: error running link.exe -out:ApplicationMain-debug.exe -nologo -machine:x86 -debug -subsystem:windows,5.01 -libpath:lib user32.lib @obj/msvc16-debug-ncxp/all_objs
Build halted with errors.
Done(1)

Does a clean build help?

openfl test windows -clean

I have never used that before, so I tried it in command prompt and this happened:

Error: You must have a "project.xml" file or specify another valid project file when using the 'test' command

When I navigated to folder where project.xml is located with command prompt and try it, neko “stopped working” and is forced to quit…

EDIT: Oh yeah, and build fails no matter what I target… Getting desperate, gonna try another haxe&lime&openfl&everything reinstall… Maybe, maybe I missed something last time :frowning:

EDIT2: … Nope, still “build halted with errors”…

Maybe I have the same error. For now, I need to delete manually the bin/windows folder to compile again…I didn’t find the source of the problem yet.

I tried that yesterday and I tried it again now, it does not help, still:

Building main
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -debug -Dfdb
Build halted with errors.
Done(1)

… This is SO frustrating… :frowning: Now I tried to “clean project” through flashdevelop & command prompt, no success…

Do you have any previous version of your project to test (throught git/svn) ?
Maybe you have a corrupted file and flashdevelop/haxe cannot determine the source…

Nope.

Though I dont believe problem is corrupted project, because I was able to replicate my issue. I created whole new OpenFl project, copypast´d my code and when I added library path to library.swf in project.xml “build halted with errors” happens with that too. And it aint due to .swf either, because I have now double checked that it’s new and clean .swf fresh from my Flash Professional.

I am starting to think that I might switch to code based graphics (or .png). This aint first time library.swf has caused me headache.

Now I get null object reference error when I tried to test doing new project with target windows… It happens when I press SPACE(32) … My test code:

package comm;

import flash.events.*;
import flash.display.*;
import flash.Lib;
import haxe.Timer;
import haxe.io.Bytes;
import lime.app.Event;
import openfl.Assets;
import openfl.display.*;
import openfl.Lib;
import openfl.system.*;
import openfl.ui.*;

class Main extends Sprite 
{

    public var container_map:Sprite;
    public var container_units:Sprite;
    public var container_buildings:Sprite;
    
    public var addentity = new New_entity();
    
    
    public function new() 
    {
        super();
        stage.addEventListener(KeyboardEvent.KEY_DOWN, mainmenu);
    }
    
    public function mainmenu(event:KeyboardEvent)
    {
        switch(event.keyCode)
        {
            case 32:
                trace("space");
                stage.removeEventListener(KeyboardEvent.KEY_DOWN, mainmenu);
                container_units.addChild(addentity);
        }
    }
    
}


class New_entity extends Sprite
{
    public function new()
    {
        super();
        this.graphics.beginFill(0x56AF75);
        this.graphics.drawRect(200, 200, 30, 30);
        this.graphics.endFill();
    }
    
}

what is going on? anyone?please… why is my Haxe&Openfl so broken suddenly, how can I fix it?

Looks like your container_units variable is null, you need to initiate it before using it.

What exactly is the error? And don’t forget to build in debug mode.

Oh yeah, I noticed that I didnt even addChild the containers, and I did their var´s wrong. My bad.

Sorry for that.

Now test works, which is nice but project I have been working on for weeks still does not work… So main problem persists. Main problem is I have been suddenly getting this when I try to debug or release targeting anything with my main project:

Building main
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -debug -Dfdb
Build halted with errors.
Done(1)

I have not done anything to the project for days, it worked fine 3 days ago, but now it wont build/compile anymore…

If you use lime test windows -debug -verbose from the command-line, what do you get?

 ___
/\_ \    __
\//\ \  /\_\    ___ ___      __
  \ \ \ \/\ \ /' __` __`\  /'__`\
   \_\ \_\ \ \/\ \/\ \/\ \/\  __/
   /\____\\ \_\ \_\ \_\ \_\ \____\
   \/____/ \/_/\/_/\/_/\/_/\/____/

Lime Command-Line Tools (3.0.2)

Initializing project...
Using project file: C:\Users\User/.hxcpp_config.xml
Reading HXCPP config: C:\Users\User\.hxcpp_config.xml
Error: You must have a "project.xml" file or specify another valid project file when using the 'test' command

That.

Did you run it from your project directory?

/\_ \    __
\//\ \  /\_\    ___ ___      __
  \ \ \ \/\ \ /' __` __`\  /'__`\
   \_\ \_\ \ \/\ \/\ \/\ \/\  __/
   /\____\\ \_\ \_\ \_\ \_\ \____\
   \/____/ \/_/\/_/\/_/\/_/\/____/

Lime Command-Line Tools (3.0.2)

Initializing project...
Using project file: C:\Users\User\Desktop\Haxeprj\openfl\comm\main/project.xml
Reading HXCPP config: C:\Users\User\.hxcpp_config.xml
Using target platform: WINDOWS

Running command: UPDATE
 - Running command: haxelib run swf process C:\Users\User\AppData\Local\Temp/temp_11827318 C:\Users\User\AppData\Local\Temp/temp_4995569 -verbose --targetDirectory=C:\Users\User\Desktop\Haxeprj\openfl\comm\main\bin\windows\cpp\debug
 - Processing library: Assets/library.swf [SWF]

Now I got this and then Neko crashed/stopped working…

Alright, which version of the SWF library do you have?

1 Like

When I type haxelib install swf it says I have swf version 2.2.3

You can use the haxelib set command to use a different version of a library, for example:

haxelib set openfl 4.0.1
haxelib set lime 3.0.1
haxelib set swf 2.2.2

Do you know what previous versions works for you? That will help us with finding the cause of the crash

1 Like

I’ll go ahead and start trying different versions. I’ll reply when and if I find one that works. Thank you for help.

Thanks! You’ll probably find the right combination by moving all these libraries in tandem, as they are usually released at the same time, it’s simplest to roll them all back one minor version at a time

Thank you

1 Like

Now it works! ITS ALIVE! THANK YOU! ITS ALIIIVE!

haxelib set openfl 4.0.1
haxelib set lime 3.0.1
haxelib set swf 2.2.2

that works!

Thank you. Seriously.

I was slowly starting to dread that 2-4 weeks went to waste on this project. Now I can continue working on it :slight_smile: Thank you!