can not find file path

hi,
I put xml file in “assets” folder(android), use follow code get file path, the file path is empty.

cocos2d::CCLog(“xml file name is %s”, CCFileUtils::fullPathFromRelativePath(“a.xml”) );

ps: this source code can good run in ios.

The “assets” folder will get replaced by the ones on the “Resources” folder when built. Place your XML files in the Resources folder instead.

Lance Gray wrote:

The “assets” folder will get replaced by the ones on the “Resources” folder when built. Place your XML files in the Resources folder instead.

I know the assets folder will be replaced by “Res” folder.
The file is existed in “asset” folder when finish build script. But I can not get correct path.

What version are you using? If you’re using 2.0.3 (I think) it has been changed to whatever you pass it. For example cocos2d::CCLog("xml file name is %s", CCFileUtils::fullPathFromRelativePath("a.xml") ); would print “xml file name is /a.xml” or something.

You should supply the correct path if you are using folder structures (like Resources/Data/a.xml). So instead of just passing “a.xml”, pass “Data/a.xml” instead.

Lance Gray wrote:

What version are you using? If you’re using 2.0.3 (I think) it has been changed to whatever you pass it. For example cocos2d::CCLog("xml file name is %s", CCFileUtils::fullPathFromRelativePath("a.xml") ); would print “xml file name is /a.xml” or something.
>
You should supply the correct path if you are using folder structures (like Resources/Data/a.xml). So instead of just passing “a.xml”, pass “Data/a.xml” instead.

I use tinyxml for parse xml file. this is my code. I can not read file

m_pXMLDoc = new TiXmlDocument( CCFileUtils::fullPathFromRelativePath(“a.xml”) );

bool bFlag = m_pXMLDoc->LoadFile();
if (!bFlag)
{
cocos2d::CCLog(“The xml file loaded failed”);
}

cocos2d::CCLog(“xml file name is %d”, bFlag);