In my application there is MainActivity contains many buttons clicking on which another activity is created with the image. Click on the image is a simple animation zoom. And there is a problem: two images of all at the frequent click crash activity (not app) with error
E/libEGL: cache file failed CRC check
I compared all the images, they are all approximately the same size and resolution. They are all jpg format. But error raise only two. Also the error does not happen on all physical devices (I tested three) but only on xiaomi redmi note 2
I googled this error and found this:
// Check the file magic and CRC
size_t cacheSize = fileSize - headerSize;
if (memcmp(buf, cacheFileMagic, 4) != 0) {
ALOGE("cache file has bad mojo");
close(fd);
return;
}
uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4);
if (crc32c(buf + headerSize, cacheSize) != *crc) {
ALOGE("cache file failed CRC check");
close(fd);
return;
}
What this error means and how to fight it?