Android and openfl.display.DisplayObject error

I just tried to compile one of my project for android but the compilation failed with many errors, all of the same type and saying:

openfl.display.DisplayObject cannot be called

The strange thing is this project works well on flash target and the lines of the source code the error messages point to seems to have nothing to do with displayObject…
So I am a bit lost here and do not know how to solve these compilation errors (I tried deleting the android folder in the “Export” folder, updated haxelib to all latest lib versions but that did not fix it)

You can run ‘openfl setup android’ in commandline for validate your system path and tools.

Do you have anywhere in your code

x = DisplayObject()

where it should be

x = new DisplayObject()

It would be helpful if you could share the line the error points to.

Found the error. Was actually calling some function from an object extending a Sprite (so a displayobject) that didn’t exists anymore (I removed the function).
The error message is really obscure though. It should just return a message saying that this function does not exist rather than this “openfl.display.DisplayObject cannot be called” message…
Stange thing also that it works on flash (probably because the part of the code where the error occurs was never called and flash target compile on the fly unlike android one…)