Unable to read file from asset


#1

When I port my game to Android platform, I got this “could not load assets/icon_xxx.png” problem. Everything works fine on Win32.
I need load several large images before I got such error, so does this mean “out of memory” ?
Any help will be appreciated!
Output is attached.


新建位图图像.jpg (29.7 KB)


output.jpg (29.7 KB)


#2

Maybe you have a problem with “the case sensitive of linux”. You have to check if the name of the file is correct. In win32 could work if you read “Picture.jpg” and the file is “picture.jpg” but in android wont work.


#3

The real problem is it works some time while most will crash. I load/unload large texture(2048x1024) when switching scenes.
Then I did some test, loading all large text at the begin and never unload them. The game become much more stable. It only crash sometimes.
Assert said something about Zip GetFileData, I guess there is a bug in calculating size when fetching a large block of data from asset


#4

BTW,sometimes only half image can be decoded.
Textures is loaded before plist files. It seems the problem only occurs when loading both texture and plist