Problems loading file from zip

have a problem using cocos2d-x on android. I am trying to load a .zip file using

CCFileUtils::sharedFileUtils()->getFileDataFromZip(…)
As this project is designed to be multiplatform, we also tried this code on an iPad3 and there it is working without problem. The problem is that the app gets an Segmentation Fault when loading the zip file.

Here is the whole code with some extra comments

@
std::stringstream filename;
filename << (int)startPoint.x << “_” << (int)startPoint.y << “.map”;
unsigned long filesize = 0;
const char* path = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(“map1.zip”);
CCLog(path);
CCLog(filename.str().c_str());
// In the following two lines the error occurs
const char* buffer =(const char**) CCFileUtils::sharedFileUtils->getFileDataFromZip.c_str, &filesize);
std::istringstream fileBuffer;
CCLogfilesize);
std::string line;
// Here some code follows but this code does not produce the problem so I left it out
@
The used includes are:
@
#include
#include
#include
#include <map>
#include “cocos2d.h”
@
The values for**path* and filename are map1.zip and ~~128_~~128.map

map1.zip is in the assets folder and the .map file exists inside map1.zip

The .map is a simple text file containing bytes, it is a binary file
filesize always stays 0

Thanks in advance

I’ve figured out why this is not working.

It seems to be the problem to pack another .zip into the .apk. When playing the .zip in the folder received by

CCFileUtils::sharedFileUtils()->getWriteablePath()

and then open the zip with

CCFileUtils::sharedFileUtils()->getFileDataFromZip(...)

the zip loads properly and I am able to read certain files from inside the zip.

And sorry for the bad formatation

Hi,

I am trying to extract images from cchttpresponse. I downloaded .zip file and saved .
how to unzip them using full path to .zip file ?
const char* buffer =(const char*) CCFileUtils::sharedFileUtils()->getFileDataFromZip(path, filename.str().c_str(), &filesize); returns NULL for me .

Thanks