Ren'Py Renpy Android FileNotFoundError: [Errno 2] No such file or directory

Celestial Novel

I Gave My Life To My Game
Game Developer
Jun 3, 2022
606
2,150
So I just updated my game, the PC and Mac version are fine but I can't create the Android version.
This is the error traceback
Code:
While running game code:
  File "game/android.rpy", line 528, in <module>
  File "game/android.rpy", line 233, in android_build
  File "game/distribute.rpy", line 657, in __init__
  File "game/distribute.rpy", line 1442, in make_package
  File "game/distribute.rpy", line 400, in hash
  File "game/distribute.rpy", line 213, in hash
  File "game/distribute.rpy", line 142, in hash_file
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\RenpyProject\\Fate and Life The Mystery of Vaulinhorngalleryandroidfixbug\\game\\narratorvoice\\bgm Then they quickly made their way out of the mansion and into the night, leaving behind only the sound of their hurried footstep, and the weight of their decision.mp3'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "launcher/game/android.rpyc", line 528, in script
  File "E:\renpy-8.0.2-sdk\renpy\ast.py", line 1131, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "E:\renpy-8.0.2-sdk\renpy\python.py", line 1052, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/android.rpy", line 528, in <module>
  File "game/android.rpy", line 233, in android_build
  File "game/distribute.rpy", line 657, in __init__
  File "game/distribute.rpy", line 1442, in make_package
  File "game/distribute.rpy", line 400, in hash
  File "game/distribute.rpy", line 213, in hash
  File "game/distribute.rpy", line 142, in hash_file
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\RenpyProject\\Fate and Life The Mystery of Vaulinhorngalleryandroidfixbug\\game\\narratorvoice\\bgm Then they quickly made their way out of the mansion and into the night, leaving behind only the sound of their hurried footstep, and the weight of their decision.mp3'

Windows-10
Ren'Py 8.0.2.22081402
Ren'Py Launcher 8.0.2.22081402
```
I think this problem occurs because I use wav format in the narrator voice audio, then I changed it back to mp3 format but it still gives me the error. I have deleted the code where I call for "bgm Then they quickly made their way out of the mansion and into the night, leaving behind only the sound of their hurried footstep, and the weight of their decision.mp3" in my script file but the error is still occurring. I have deleted my persistent file and force recompile but the problem still exists. I think I may need to delete something in my renpy-8.0.2-sdk folder but I don't know what it is
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,192
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\RenpyProject\\Fate and Life The Mystery of Vaulinhorngalleryandroidfixbug\\game\\narratorvoice\\bgm Then they quickly made their way out of the mansion and into the night, leaving behind only the sound of their hurried footstep, and the weight of their decision.mp3'
First thing first, learn to shorten your file names. 166 characters is long, way too long.


I think this problem occurs because I use wav format in the narrator voice audio, then I changed it back to mp3 format but it still gives me the error.
Unless the error changed, the fact that it was a wav file is not the reason why the file was said as missing. A more plausible explanation is the 265 character long Fully Qualified File Name, that goes over Windows default limits, and can have lead this particular file to be forgotten when the Android distribution file have been built.
At least, have you verified that the missing file is in the pak archive ?


I have deleted the code where I call for [...] in my script file but the error is still occurring.
I guess that it's because the music was playing (or expected to be playing) when the save was created. Therefore Ren'Py automatically try to start it when you load a save file.


I think I may need to delete something in my renpy-8.0.2-sdk folder but I don't know what it is
Nothing, there's nothing to delete there... there's nothing you should even touch there.
 

Celestial Novel

I Gave My Life To My Game
Game Developer
Jun 3, 2022
606
2,150
First thing first, learn to shorten your file names. 166 characters is long, way too long
It worked on PC version and I have so many files so I didn't bother to shorten it lol:pThough if I knew that could be a problem I would not do that

At least, have you verified that the missing file is in the pak archive ?
How to verify that?

Nothing, there's nothing to delete there... there's nothing you should even touch there.
I mean I tried to create new project with the same files except with the problematic script file but it still gave me the same exact error even though I'm not touching the bgm file so I thought there must be something that needs to be deleted so I could restart things
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,192
It worked on PC version and I have so many files so I didn't bother to shorten it lol:pThough if I knew that could be a problem I would not do that
Well, personally I see 170^96 reasons to not have a 166 characters long filename. They all share the same name, "typo".


How to verify that?
Any archives manager (7zip by example) should be able to open a PAK file.
 
  • Haha
Reactions: Celestial Novel

Celestial Novel

I Gave My Life To My Game
Game Developer
Jun 3, 2022
606
2,150
Well, personally I see 170^96 reasons to not have a 166 characters long filename. They all share the same name, "typo".
:ROFLMAO: :ROFLMAO:

Any archives manager (7zip by example) should be able to open a PAK file.
Wait wait, what is this PAK file we are talking about? Where can I find that? I mean the error occurred when I tried to build the android version and after that I didn't get any .apk file
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,192
Wait wait, what is this PAK file we are talking about? Where can I find that? I mean the error occurred when I tried to build the android version and after that I didn't get any .apk file
Oh, my bad, I forgot the context while writing, and thought that the port was already built.

Therefore, I tend to stick on the too long filename as being the reason of the error. Especially if it happen when you don't refer to it ; I guess that the file itself is still present. Ren'Py find the file when it browse the game tree to list the files to add in the PAK file, but when come the time to address it and effectively add it, the long filename, or FQFN, generate the error.
 

Celestial Novel

I Gave My Life To My Game
Game Developer
Jun 3, 2022
606
2,150
Oh, my bad, I forgot the context while writing, and thought that the port was already built.

Therefore, I tend to stick on the too long filename as being the reason of the error. Especially if it happen when you don't refer to it ; I guess that the file itself is still present. Ren'Py find the file when it browse the game tree to list the files to add in the PAK file, but when come the time to address it and effectively add it, the long filename, or FQFN, generate the error.
Then how to fix that? I assume there must be something that needs to be deleted and let Renpy recreate it again right?