Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] App throwing "Could Not Find Image" error after being installed on Android?

Author
Message
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Apr 2021 11:00
G'day - getting back into it after a long break away so I apologise if this is a stupid thing... I've got a build that works just fine on my dev pc, but once I build it into an APK file and install it on an Android device I get an error saying it could not find an image. I have the storage access permission granted on the device, however... Anyone have any ideas why this would be happening? Am I meant to be deliberately packaging assets with my APKs? I could have sworn AppGameKit does that automatically as part of the build process...

The author of this post has marked a post as an answer.

Go to answer

Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 17th Apr 2021 12:25
This post has been marked by the post author as the answer.
The most common issue is incorrect case in the filename.

For example, if your code is looking for "image.jpg" and your filename is "image.JPG" then windows will find it but Android won't. Android filenames are case sensitive.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Use virtual resolution instead of the default percentage system." - Digital Awakening
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Apr 2021 12:49
That's an awesome tip. I'll try that. Thank you!
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Apr 2021 13:49
That did it! Thank you
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 17th Apr 2021 15:59
Anytime
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Use virtual resolution instead of the default percentage system." - Digital Awakening
EdzUp
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 30th May 2021 20:02
FWIW Microsoft OS's are the only ones that ignore case, Linux/Android/OSX etc are all based on a Unix or one of its derivatives and this treates Filename, FILENAME and FileName as three separate files where windows would see just the one file called FILENAME

It's one of the things that makes windows coders lazy coders as it's one less thing to remember but it's always good to check
-EdzUp
Patreon: https://www.patreon.com/EdzUp
Buy me a coffee:https://www.buymeacoffee.com/EdzUp

Login to post a reply

Server time is: 2024-04-24 15:19:32
Your offset time is: 2024-04-24 15:19:32