NME starter project doesn't build at all, multiple issues.

110 views
Skip to first unread message

MISSINGNO

unread,
May 6, 2013, 11:55:14 AM5/6/13
to aw...@googlegroups.com
Hi, 

I am new to haXe, NME, and awe6. I have demo projects for each building so i know that they do work. however I am now trying to build the awe6 nme starter project and I am not getting anywhere.

I am using te latest version of awe6, NME, and 2.10 of haXe.

I created the NME project using :

haxelib run awe6 create project nme "Test" "com.game.Test" "Me"

Then I tried to just build without doing anything and for html5 and flash platforms I get the error :

src/Main.hx:1: characters 0-29 : Class not found : com.game.Test

So I took a look at the Test.nmml file and noticed that "com.example." was added to the beginning of the package I supplied, So I removed that and tried again, same problem. I then looked at the folder structure and noticed that the src is in a single folder called "com.game.Test/" instead of nested folders "com/game/Test", so I manually changed that, same issue.

For ios the build fails and I get the following:

Error : Resource file not found : assets/_exclude/config.xml

"config.xml" is in the projects assets directory but it's not being added to the xcode project (which makes sense because of the exclude property on the assets nodes in Test.nmml).

I have seen a couple posts about these exact issue but none of them had a resolution. Does anyone know what the problem is ?

Thanks.

Rob Fell

unread,
May 6, 2013, 12:16:16 PM5/6/13
to aw...@googlegroups.com
 
Hi, thanks for your post - please help us resolve these issues.
 
Yes these issues are to do with the template scripts for Mac & Linux.  Anyone using Windows / FlashDevelop templates are unaffected.
 
Unfortunately I don't have access to a Mac at the moment so I can't investigate these personally.  What I can do is provide some info by which you may be able to investigate further, resolve :), provide me a patch, and then I'll update the release.

First "Resource file not found".  This is using Haxe resource, so outside of the NME nmml assets scope.  Notice the compilerflag in the nmml file:
<compilerflag name="-resource assets/managed/_exclude/config.xml@config" />
If you try and add a resource in a different folder, does it work?  Are the "/" the right way for Mac etc?
 
Second NME project main and package and other renaming.  Looks like many bugs here (from awe6.extras.Run).  Can you create a new project, zip it and send it to me please.  From there I will try and correct then send you a new Run.n to validate.
 
Thanks, Rob

MISSINGNO

unread,
May 6, 2013, 12:48:17 PM5/6/13
to aw...@googlegroups.com
Thanks for the quick reply, 

I tried moving the config.xml file outside the _exclude folder and it was found fine, so that issue must have to do with the excluding of that directory in the nmml file.

    <assets path="assets" rename="assets" include="*" exclude="_exclude|*.ogg" if="flash" />
    <assets path="assets" rename="assets" include="*" exclude="_exclude" unless="flash" />

I tried just removing the asset exclude lines form the file but that didn't work, so I just moved the config file out of that folder and changed the path and that's fine. The ios build now gets the same class not found error as the other builds.

I created a brand new project and zipped the project folder and attached it.

Thanks a lot.
awe6 nme Test.zip

Rob Fell

unread,
May 6, 2013, 12:57:49 PM5/6/13
to aw...@googlegroups.com
Thanks.  I'm working through it now (on WIndows).
 
The resource exclude is bizarre because on Windows, Swf, Android and Html5 builds it supposedly works fine where it was.  I can't see why NME would behave differently for this per platform (or why resource is effected by nmml asset nodes at all?).  How does it behave for Mac build (not iOS)?  If you were to place it in a folder called "test/managed/_exclude" does that work?
 
Which Haxelib version are you running (for the Run script)?  I assume 2.10 so will build to that for tests.

MISSINGNO

unread,
May 6, 2013, 1:20:34 PM5/6/13
to aw...@googlegroups.com
It is weird, it doesn't complain about the following line but it does with the config file in the compilerflag line:

<icon name="assets/_exclude/nme.svg" />

mac works fine (until class not found anyway), so it appears that only iOS is affected.

I have haXe 2.10 installed, and haxelib says it's 1.03 in the terminal when showing usage details.

Thanks.

Rob Fell

unread,
May 6, 2013, 4:24:41 PM5/6/13
to aw...@googlegroups.com
I have a test candidate available for you here:
 
Please download and copy it to your haxelib folder - e.g.:
C:\Motion-Twin\haxe\lib\awe6\1,3,522
 
NOTE - You may wish to rename the existing run.n file beforehand.
 
Then please try the create syntax:
haxelib run awe6 create project nme $projectName $package $author
 
Please let me know what happens.
 
I get an exception on a sys_create_dir method, but I put this down to running it on Windows using old neko.  New neko (available with the Haxe3 release) builds and works fine on my Windows setup.  Once Haxe3 is released officially I will be able to migrate this run.n file properly.
 
Please note I have not addressed the config file exclusion issue.

MISSINGNO

unread,
May 6, 2013, 4:46:59 PM5/6/13
to aw...@googlegroups.com
Hi Rob,

I get the sys_create_dir exception as well. 

Called from ? line 1
Called from awe6/extras/Run.hx line 77
Called from awe6/extras/Run.hx line 58
Called from a C function
Called from awe6/extras/Run.hx line 89
Called from awe6/extras/Run.hx line 132
Called from awe6/extras/Run.hx line 360
Called from C:\Motion-Twin\haxe/std/neko/_std/sys/FileSystem.hx line 70
Uncaught exception - std@sys_create_dir

I can work around the config file issue, that's not a problem I don't think

Thanks.

Rob Fell

unread,
May 6, 2013, 6:18:28 PM5/6/13
to aw...@googlegroups.com
Please retry (grab the run.n file from url above).
 
I have attempted to patch that createDirectory issue (by merging some Haxe3 std lib features back into this 2.1 build)

MISSINGNO

unread,
May 7, 2013, 10:04:45 AM5/7/13
to aw...@googlegroups.com
Hi Rob,

The project is now created properly (no extra com.example. and the folder structure is correct) however I still get the Class Not Found exception.

Rob Fell

unread,
May 7, 2013, 12:24:10 PM5/7/13
to aw...@googlegroups.com
Thank you for confirming.
 
Yes I can replicate the Class Not Found exception. 
iirc Haxe expects packages to be lowercase and classes as PascalCase.
So if we keep the packageName as lowercase then that issue is resolved:
 
com.game.test
 
This will then assume, and create, a Main class at:
 
com.game.test.Main
 
Thanks again for helping me fix this.

MISSINGNO

unread,
May 7, 2013, 12:55:47 PM5/7/13
to aw...@googlegroups.com
That worked perfect. Thanks for the help. It now builds and runs. There are still some issues with the project but they are a different thing altogether.

> html5 doesn't display properly (attached image)
> flash works great.
> iOS has the problem already reported here (https://code.google.com/p/awe6/issues/detail?id=16) but I can work around that in my own project if need be.

Thanks.
html5.tiff

Rob Fell

unread,
May 7, 2013, 1:58:26 PM5/7/13
to aw...@googlegroups.com
Sorry, couldn't replicate html5 issue - all assets load, progress bar completes and game enters first scene.  Tested on IE9 and FF20 (Windows 7).
 
Perhaps try deleting each of the assets/overlay bitmaps one by one (starting with OverlayBackground.png) to see if it is related to a specific asset?

MISSINGNO

unread,
May 7, 2013, 3:47:23 PM5/7/13
to aw...@googlegroups.com
I stripped the project down to the bare minimum Hello World and it does the same thing in HTML5. I checked the chrome console and it says :

XMLHttpRequest cannot load file://localhost/<game path>/export/html5/bin/assets/config.xml. Cross origin requests are only supported for HTTP.
Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101

Rob Fell

unread,
May 7, 2013, 5:42:40 PM5/7/13
to aw...@googlegroups.com
By default the config.xml is in assets/_exclude where it should compile to html5 (or any non iOS targets).  This location avoids it being bundled into NME's asset loader (which I assume is causing this issue due to local file access sandbox?)
 
Possible workarounds:
 
1) Keep config.xml in the _exclude folder and we'll ask NME team why iOS is not behaving as other platforms do with regards Haxe resource
2) Move config.xml outside of assets (e.g. folder below) to ensure it's not included in NME assets but can be included in Haxe resource
3) Inline the contents of config.xml (as per HelloWorld) into Main.hx and remove config.xml from assets folder and compilerflag
4) Run your test file through a webserver so all requests are http (?)

Mike Fleischauer

unread,
May 13, 2013, 12:56:56 PM5/13/13
to aw...@googlegroups.com
That is Chrome's fault.  It wont let you access an XML file locally.

You have one of three options:
1- use Firefox or another browser for development
2- run your HTML project from a local webserver instead of via file://
3- start chrome using the following commandline: chrome --allow-file-access-from-files

MISSINGNO

unread,
May 14, 2013, 12:28:37 PM5/14/13
to aw...@googlegroups.com
Thanks for all the help Rob and Mike.
Reply all
Reply to author
Forward
0 new messages