XML asset in project.xml showing lime error: TEXT asset 'xml1' exists but only asynchronously

I have assets mentioned in the project.xml as follows :

<assets path='assets/game' rename='' >
<xml path='myxml.xml' id='xml1' />
</assets>

error for html5 target says:

uncaught exception: [lime.utils.Assets] ERROR: TEXT asset ‘xml1’ exists, but only asynchronously

It was all working fine. But not it’s showing the above error. What does the error means to say?

It means: you should load it explicitly

Assets.getText(pathToXML);

But I need to use ID, because it helps me to choose the xml dynamically. I mean, the id can be used by the server side file, to load a particular xml.

well, I don’t know, I never use it on that way by ID from project.xml. I alway have my own settings.xml where I keep all references for current game/application.

The another problem with getText is that it does not allow to put path there. It forces to put an ID, otherwise shows a runtime error: No such ID exists

I was able to make it work by using

Assets.loadText( 'the-id').onComplete( 

    function(e)
{
    var str:String =   Assets.getText('the-id') ;
}

); 

But I think, the main problem creator was this line:
<haxedef name='simulate-preloader' value='1000' />

I made the value from 5000 to 1000. Which probably was forcing the preloader to end before the app could load everything. So, every Asset function was showing the error, for an ID available asynchronously only.

I have something like this in project.xml

<assets path="assets/data" rename="data" />

then I call:

var xmlString:String=Assets.getText("data/settings.xml");

and I can parse xml immediately, I don’t need to wait to load function.

That’s because your project is probably set up to embed these assets. Some targets embed by default, others require loading external assets at runtime.

<assets path="..." embed="true" />