Android compilation error

96 views
Skip to first unread message

Thomas Bernard

unread,
Aug 31, 2015, 9:49:11 AM8/31/15
to HaxeFlixel
I am trying to integrate BabylonHx with haxeflixel but when compiling for android, the compilation stop with this message:

C:/HaxeToolkit/haxe/lib/lime/2,4,7/lime/Assets.hx:498: characters 31-57 : DefaultAssetLibrary should be lime.AssetLibrary
C:/HaxeToolkit/haxe/lib/lime/2,4,7/lime/Assets.hx:498: characters 31-57 : For function argument 'library'

It seems to be an issue already encountered with openfl-bitfive: 


But here, I am not compiling for HTML5 target but for android so I don't think the compiler would use openfl-bitfive...

I fixed it by changing line 498 of the lime.Asset class from 

registerLibrary ("default", new DefaultAssetLibrary ());

to 

registerLibrary ("default", new AssetLibrary());

as the error message suggested and it now seems to compile correctly. But it would be better to have a permanent fix that would not requiere me to change these lines at each update of the lime lib ...
Any idea on how to do this?



My configuration:

actuate: 1.7.5 1.8.5 [1.8.6]
akifox-asynchttp: [0.4.1]
BabylonHx: git [dev:C:\HaxeToolkit\haxe\lib/BabylonHx/git]
box2d: [1.2.3]
extension-iap: [1.1.0]
extension-locale: [1.0.0]
extension-share: 1.2.2 [2.1.0]
extensionkit: git [dev:C:\HaxeToolkit\haxe\lib/extensionkit/git]
firetongue: [1.0.0]
flixel-addons: [1.1.0] git
flixel-demos: 1.1.1 [1.1.2]
flixel-templates: [1.0.2]
flixel-tools: 1.0.2 1.0.5 1.1.0 [1.1.1]
flixel-ui: [1.0.2]
flixel: 3.3.6 3.3.8 [3.3.9] git
haxe-ga: 0.4.16 0.4.21 0.5.0 [0.5.2]
haxe-gif: [0.3.3]
haxelib_client: 3.1.0-rc.4 [3.2.0-rc.3]
hxColorToolkit: [1.6.0]
hxcpp: 3.1.39 [3.2.102] 3.2.94
layout: [1.2.0]
lime-samples: [2.3.0]
lime: 2.0.0 2.0.0-alpha 2.0.1 2.4.1 2.4.3 2.4.4 2.4.6 [2.4.7]
mobiledisplay: git [dev:C:\HaxeToolkit\haxe\lib/mobiledisplay/git]
nape: 2.0.16 [2.0.19]
OimoHx: git [dev:C:\HaxeToolkit\haxe\lib/OimoHx/git]
openfl-admob: 1.2.1 1.2.2 1.4.0 [1.4.1]
openfl-gpg: 1.0.0 1.2.2 [1.3.0]
openfl-gps-lib: 1.0.1 1.0.2 [1.0.4]
openfl-locale: 1.0.0 [1.0.1]
openfl-samples: 2.1.0 [2.2.2]
openfl-share: 1.2.0 [1.2.2]
openfl: 2.1.0 2.1.6 2.1.7 3.0.0-beta.2 3.0.6 3.0.8 3.1.0 [3.1.1]
poly2trihx: [0.1.4]
polygonal-ds: [1.4.1]
polygonal-printf: [1.0.2-beta]
svg: [1.0.8]
swf: 1.6.0 1.6.9 1.7.0 1.8.7 1.8.8 [1.8.9]
systools: [1.1.0]
task: [1.0.6]
thx.color: [0.16.0]
thx.core: 0.25.1 [0.26.0]
thx.culture: [0.3.0]
thx.format: [0.2.1]
thx.promise: [0.5.1]
thx.semver: [0.2.2]
thx.stream: [0.4.1]
thx.unit: [0.4.1]

SruloArt

unread,
Aug 31, 2015, 10:57:45 AM8/31/15
to HaxeFlixel
* This stems from the BabylonHX library, not HaxeFlixel AFAIK, so the solution should be over there...

Thomas Bernard

unread,
Aug 31, 2015, 12:09:15 PM8/31/15
to HaxeFlixel
Actually,

replacing 

registerLibrary ("default", new DefaultAssetLibrary ());

by 

registerLibrary ("default", new AssetLibrary());

resolve the compilation error issue but introduce other issue as now, all assets import are broken (results in an unfound asset error message).


What I don't understand is why I have this message:

C:/HaxeToolkit/haxe/lib/lime/2,4,7/lime/Assets.hx:498: characters 31-57 : DefaultAssetLibrary should be lime.AssetLibrary
C:/HaxeToolkit/haxe/lib/lime/2,4,7/lime/Assets.hx:498: characters 31-57 : For function argument 'library'

when using babylonHx in combination with haxeflixel.

Just using haxeflixel is OK and do not result in this message. A soon as I make an import of a babylonHx class in one of my flixel object (a flxstate), it crash with this message.
Using bablylonHx with pure Openfl also works though (so the problem is not really on the babylonHx part either). This is really the interaction between haxeflixel and babylonhx that causes issue but i don't know why (as babylonhx works with openfl, it should also work with haxeflixel no?)

SruloArt

unread,
Aug 31, 2015, 12:48:13 PM8/31/15
to HaxeFlixel
* try to add this flag:
<set name="openfl-legacy" />
before you import openfl (probably in the include.xml over your flixel repo folder).

* And when you can, update your libraries...


Thomas Bernard

unread,
Aug 31, 2015, 3:20:37 PM8/31/15
to haxef...@googlegroups.com
Well if I did this (I changed <set name="legacy" unless="next" /> to <set name="openfl-legacy">), but I still have the error

I also performed an haxelib upgrade and now have this config:


actuate: 1.7.5 1.8.5 [1.8.6]
akifox-asynchttp: [0.4.1]
BabylonHx: git [dev:C:\HaxeToolkit\haxe\lib/BabylonHx/git]
box2d: [1.2.3]
extension-iap: [1.1.0]
extension-locale: 1.0.0 [1.0.1]

extension-share: 1.2.2 [2.1.0]
extensionkit: git [dev:C:\HaxeToolkit\haxe\lib/extensionkit/git]
firetongue: [1.0.0]
flixel-addons: [1.1.0] git
flixel-demos: 1.1.1 [1.1.2]
flixel-templates: [1.0.2]
flixel-tools: 1.0.2 1.0.5 1.1.0 [1.1.1]
flixel-ui: [1.0.2]
flixel: 3.3.6 3.3.8 [3.3.9] git
haxe-ga: 0.4.16 0.4.21 0.5.0 [0.5.2]
haxe-gif: [0.3.3]
haxelib_client: 3.1.0-rc.4 [3.2.0-rc.3]
hxColorToolkit: [1.6.0]
hxcpp: 3.1.39 [3.2.102] 3.2.94
layout: 1.2.0 [1.2.1]
lime-samples: 2.3.0 [2.6.0]
lime: 2.0.0 2.0.0-alpha 2.0.1 2.4.1 2.4.3 2.4.4 2.4.6 2.4.7 [2.6.1]

mobiledisplay: git [dev:C:\HaxeToolkit\haxe\lib/mobiledisplay/git]
nape: 2.0.16 [2.0.19]
OimoHx: git [dev:C:\HaxeToolkit\haxe\lib/OimoHx/git]
openfl-admob: 1.2.1 1.2.2 1.4.0 [1.4.1]
openfl-gpg: 1.0.0 1.2.2 [1.3.0]
openfl-gps-lib: 1.0.1 1.0.2 [1.0.4]
openfl-locale: 1.0.0 [1.0.1]
openfl-samples: 2.1.0 2.2.2 [3.3.0]
openfl-share: 1.2.0 [1.2.2]
openfl: 2.1.0 2.1.6 2.1.7 3.0.0-beta.2 3.0.6 3.0.8 3.1.0 3.1.1 [3.3.2]

poly2trihx: [0.1.4]
polygonal-ds: [1.4.1]
polygonal-printf: [1.0.2-beta]
svg: [1.0.8]
swf: 1.6.0 1.6.9 1.7.0 1.8.7 1.8.8 1.8.9 [2.0.1]
systools: [1.1.0]
task: [1.0.6]
thx.color: 0.16.0 [0.17.0]
thx.core: 0.25.1 0.26.0 [0.32.0]
thx.culture: 0.3.0 [0.4.0]
thx.format: 0.2.1 [0.4.0]

SruloArt

unread,
Aug 31, 2015, 3:37:21 PM8/31/15
to HaxeFlixel
* I was just puzzled you had all of these outdated libraries, and didn't think this line was available on your templates. Revert your include.xml to whatever it was before you've made any changes to it, and then go to your project.xml and add this line:
<set name="next" />
before you add flixel.

* Your Flixel version is also outdated btw (should be 3.3.11 AFAIK), so update that, and don't forget you can and should update all of your libraries at once with this command: "haxelib upgrade", so do that every once and a while :)

Thomas Bernard

unread,
Aug 31, 2015, 6:00:42 PM8/31/15
to HaxeFlixel


On Monday, August 31, 2015 at 9:37:21 PM UTC+2, SruloArt wrote:
* I was just puzzled you had all of these outdated libraries, and didn't think this line was available on your templates. Revert your include.xml to whatever it was before you've made any changes to it, and then go to your project.xml and add this line:
<set name="next" />
before you add flixel.

If I do so, wouldn't I have issues?
Not that long ago, sharedobjects where not yet implemented in the new openfl. I don't know if it has been fixed yet. But for now, I think I would stick with openfl_legacy until openfl 3 is fully supported by haxeflixel...
 

* Your Flixel version is also outdated btw (should be 3.3.11 AFAIK), so update that, and don't forget you can and should update all of your libraries at once with this command: "haxelib upgrade", so do that every once and a while :)

This is the command I use actually. And I perform an haxelib upgrade ~each 15j. Flixel 3.3.9 is the latest version propsed by haxelib for me (haxelib upgarde says that my flixel version is up to date...)
 


SruloArt

unread,
Aug 31, 2015, 6:35:41 PM8/31/15
to HaxeFlixel
* We're not trying to set-up a proper dev environment, we're trying to see if HaxeFlixel has anything to do with your error, and Openfl/Lime related flags are the only reasonable connection.

* Talking about proper set-up, your current flixel version is unlikely: https://github.com/HaxeFlixel/flixel/blob/3.3.11/haxelib.json, maybe you should reinstall Haxe or at least run "haxelib selfupdate" and try "haxelib upgrade" again. If the problem persists I would purge everything and start over, because something is obviously wrong with your setup. Who knows, maybe that's your error's culprit.

Thomas Bernard

unread,
Aug 31, 2015, 8:28:54 PM8/31/15
to haxef...@googlegroups.com

* We're not trying to set-up a proper dev environment, we're trying to see if HaxeFlixel has anything to do with your error, and Openfl/Lime related flags are the only reasonable connection.
Understood. Well, using the
<set name="next" />
I no longer have the error saying:

C:/HaxeToolkit/haxe/lib/lime/2,4,7/lime/Assets.hx:498: characters 31-57 : DefaultAssetLibrary should be lime.AssetLibrary
C:/HaxeToolkit/haxe/lib/lime/2,4,7/lime/Assets.hx:498: characters 31-57 : For function argument 'library'
(if I remove the tag, I still have the error. So this is not the flixel or haxelib upgrade that fixed it)
and the project compiles correctly for android. However, the build app imediately close (crash) after the flixel preloader but without any error in the console. So there is some progress but there is still an issue as the same project build with openfl run correctly. (to transform my openfl working project into a flixel project, I basically just added the openfl.Sprite that my Main openfl class extends to a Flxstate using FlxG.addChildBelowMouse() )

I also tried to build my project for html5 but in that case, whatever I add the <set name="next" /> tag or not, the project compiles with warnings saying :
Warning: Could not find generated font file "C:/HaxeToolkit/haxe/lib/flixel/3,3,11/assets/fonts/nokiafc22.eot"
Warning: Could not find generated font file "C:/HaxeToolkit/haxe/lib/flixel/3,3,11/assets/fonts/nokiafc22.woff"
Warning: Could not find generated font file "C:/HaxeToolkit/haxe/lib/flixel/3,3,11/assets/fonts/nokiafc22.svg"
Warning: Could not find generated font file "C:/HaxeToolkit/haxe/lib/flixel/3,3,11/assets/fonts/arial.eot"
Warning: Could not find generated font file "C:/HaxeToolkit/haxe/lib/flixel/3,3,11/assets/fonts/arial.woff"
Warning: Could not find generated font file "C:/HaxeToolkit/haxe/lib/flixel/3,3,11/assets/fonts/arial.svg"
and render as a black screen with these errors in the firefox console:
"NetworkError: 404 Not Found - http://localhost:3000/assets/fonts/arial.woff"
and without any error in chrome (but still a black screen)
The same BabylonHx project in pure openfl renders correctly (both in firefox and chrome) whatever I use openfl_legacy or openfl 3/hybrid.


* Talking about proper set-up, your current flixel version is unlikely: https://github.com/HaxeFlixel/flixel/blob/3.3.11/haxelib.json, maybe you should reinstall Haxe or at least run "haxelib selfupdate" and try "haxelib upgrade" again. If the problem persists I would purge everything and start over, because something is obviously wrong with your setup. Who knows, maybe that's your error's culprit.

OK. I had to do:
haxelib install flixel
for flixel 3.3.11 to be installed (for any strange reason, the haxelib update did not work in my case and said that my flixel version was up-to-date even after having performed an
haxelib selfupdate. But the "haxelib install flixel" command forced it to download the latest version)

SruloArt

unread,
Sep 1, 2015, 3:56:33 AM9/1/15
to HaxeFlixel
* Right, so, like I've originally assumed, babylonHX works with OpenFL next, and HaxeFlixel doesn't support that yet, so you would have to change the BabylonHx library with proper version flags (if it doesn't actually relies on actual OpenFL-next code, of course) if you want to have some kind of a solid integration with flixel 3.3.11.

* That's a whole other issue, html5 won't work with the current default flixel fonts/sound files if on Firefox or IE 11. There's an open issue over the Lime repo if you want more details. You can just comment out the whole assets stuff in your include.xml (but then you can't use the default Splash screen [it's not a preloader, that doesn't exist on Android] and/or demos that use these fonts, naturally).
Reply all
Reply to author
Forward
0 new messages