cocos2d3.2项目转安卓是解析xml文档报错。

string filePath = FileUtils::getInstance()->fullPathForFilename(fileName);
tinyxml2::XMLDocument *pDoc = new tinyxml2::XMLDocument();
tinyxml2::XMLError pError = pDoc->LoadFile(filePath.c_str());
log(“filePath == %s”,filePath.c_str());

tinyxml2::XMLElement *pRootElem = pDoc->RootElement();
log(“1”);
XMLElement *pDicElem = pRootElem->FirstChildElement();
log(“2”);
XMLElement *pKeyElem = pDicElem->FirstChildElement();
log(“3”);
XMLElement *pChildElem = pKeyElem->FirstChildElement();
log(“4”);
只打印出了1,报错为Fatal signal 11 (SIFSEGV) at 0x00000018 (code = 1),thread 5851(therad-927)
有大神知道嘛?切解答。

楼主试试看这个方法行不行http://www.eoeandroid.com/thread-248896-1-1.html

问题解决了,谢谢。

请问楼主怎么解决的呢?我也是遇到这个问题,按照一楼的方法也不行啊

tinyxml2::XMLDocument pDoc;

#if(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
ssize_t temp = 0;
unsigned char
pBuffer = NULL;
pBuffer = FileUtils::sharedFileUtils()->getFileData(fileName,“r”,temp);
if (pBuffer)
{
pDoc.Parse((const char*)pBuffer);
}
#else
string filePath = FileUtils::getInstance()->fullPathForFilename(fileName);
tinyxml2::XMLError pError = pDoc.LoadFile(filePath.c_str());
#endif
tinyxml2::XMLElement *pRootElem = pDoc.RootElement();
XMLElement *pDicElem = pRootElem->FirstChildElement();
XMLElement *pKeyElem = pDicElem->FirstChildElement();