std::string zipFilePath = FileUtils::getInstance()->fullPathForFilename(archiveName);
if (zipFilePath.compare(archiveName) == 0) {
CCLog("Path didn't contain: %s", zipFilePath.c_str());
return false;}
else
CCLog("%s opening from path : %s", archiveName, zipFilePath.c_str());
ZipFile zf(archiveName, "assets/");
long int size;
char *myText = (char*)(zf.getFileData(sourceFileName, &size));
if (myText == nullptr) {
CCLog("%s not found in archive: %s", sourceFileName, zipFilePath.c_str());
return false;
}
I keep getting “not found in archive” how can I get a fuller error description from the ZipFile
constructor? The docs state I can and should supply “assets/” but there was a post earlier about not being able to put zips in assets but I think that was referring to FileUtils::sharedFileUtils()->getFileDataFromZip(
which makes me reluctant to try it, but as I have no better error code to go on, try it I must. More information about apks and zips was provided here