Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Android RPG Maker MV Guide

Tuomo L

Towns Guard
You can try deleting the build-cache, which is located here: <user-home>/.android/build-cache/ (WARNING THIS COULD BREAK ANDROID STUDIO - CLOSE THE PROGRAM BEFORE DELETING)

However, Android Studio does not cache the Assets folder - there isn't any reason to cache this folder as it's expected to be raw data so the program doesn't cache it at all and expects the Assets to be modified between builds. I very highly doubt deleting the cache will solve your problem - especially when you're getting missing image errors, which are RPG Maker MV errors, not Android or Android Studio errors (Android Studio does not track the contents of the Assets folder - at all).

I doubt your device is holding a cache either as 100% of the code related to resource management comes from your RPG Maker MV project, there's nothing that would cause a device to cache code. You can rule this scenario out by uninstalling the game from your Android device then installing the APK again. I'm guessing you've already tried this.

After ruling out the fact that the zero caching is happening here, the only thing left that could be causing this RPG Maker MV error is something inside the RPG Maker MV project: RPG Maker MV errors are always due to project or Plugin bugs. These are the 99.999% of errors people get. Make sure your project is not WebGL only (test it in canvas graphics mode, the community basics Plugin can do this), make sure your project is not Windows-only (file names must be correct casing - try your project on Mac or Linux to test this) and make sure your project is not desktop-only (test it on Web). Testing on Android also proves that it is not desktop-only, and from what you're saying this test is failing.

Because this is not a WebGL exception, the blame isn't WebGL support on your device.

Process of elimination is that a Plugin is misbehaving. The fact that you refuse to tell us what Plugins you are using makes me even more convinced that this is the case (combined with the fact that 99.999% of everyone else's errors have been Plugin related so far). You need to tell us what Plugins you are using, otherwise we cannot help you. Help us help you is what I'm asking for.

Further things to diagnose: When is this error appearing? Does it appear at the title screen when the game loads? Does it appear when a map loads? Does it appear after New Game or Continue? What is the file path of the image in the error? If a regular show picture from a show picture command is causing the title screen to crash then you know for certain that it's a Plugin causing the problem (attempting to pe-load images from some kind of cache or compressed data directory). Show picture will only load a picture when it is used on the map.
Well, I mean you wanted them you got them

java.io.FileNotFoundException

At img/pictures

The error appears when I try to copy the WWW folder to Android Studio. Crashes do not occur in RPG Maker MV anywhere. This is again, completely isolated into Android Studio and in no other deploy program that I've used.

I also cannot delete assets folder, it's grayed out. That's why i am certain this issue is related to somehing in Android Studio, but I have no idea how it's asking for a picture that wasn't even in present when I deployed the game or copied the WWW to there in the first place.
 
Last edited:

Xilefian

Adventurer
Xy$
0.00
java.io.FileNotFoundException

At img/pictures

The error appears when I try to copy the WWW folder to Android Studio. Crashes do not occur in RPG Maker MV anywhere. This is again, completely isolated into Android Studio and in no other deploy program that I've used.

I also cannot delete assets folder, it's grayed out. That's why i am certain this issue is related to somehing in Android Studio, but I have no idea how it's asking for a picture that wasn't even in present when I deployed the game or copied the WWW to there in the first place.
Aha thank you, this information tells me everything! Thank you!!!

I'm going to first apologise to you; I thought you were getting a file not found error in a deployed RPG Maker MV project - rather than in the Android Studio editor itself. Sorry! It's very (very!) rare to get errors like this one in Android Studio itself because they tend to happen when a configuration goes wrong (operating system buggers something up).

The greyed out assets folder in Android Studio is an issue with git - you can ignore it, however I suggest you delete the Android project entirely just to make sure nothing is corrupted. Re-download the MV Android Client from the first post to make sure you have the latest version.

My other advice is to avoid pasting your WWW in Android Studio, instead go directly into the assets directory through your file explorer. Open up the Android project and navigate to: app\src\main\assets (create the asset folder in file explorer if it doesn't exist) and paste your WWW folder there manually. This method will copy the folder via your operating system, so any permission errors will be reported directly to you (rather than through an obscure error in Android Studio, which is just passing on the error message from your OS).


Feel free to remove the list of Plugins from your previous post to clean up the thread. Do note that some of those Plugins will cause you issues, but I'm confident you have the skills to identify them without anyone's help.
 

Tuomo L

Towns Guard
Aha thank you, this information tells me everything! Thank you!!!

I'm going to first apologise to you; I thought you were getting a file not found error in a deployed RPG Maker MV project - rather than in the Android Studio editor itself. Sorry! It's very (very!) rare to get errors like this one in Android Studio itself because they tend to happen when a configuration goes wrong (operating system buggers something up).

The greyed out assets folder in Android Studio is an issue with git - you can ignore it, however I suggest you delete the Android project entirely just to make sure nothing is corrupted. Re-download the MV Android Client from the first post to make sure you have the latest version.

My other advice is to avoid pasting your WWW in Android Studio, instead go directly into the assets directory through your file explorer. Open up the Android project and navigate to: app\src\main\assets (create the asset folder in file explorer if it doesn't exist) and paste your WWW folder there manually. This method will copy the folder via your operating system, so any permission errors will be reported directly to you (rather than through an obscure error in Android Studio, which is just passing on the error message from your OS).


Feel free to remove the list of Plugins from your previous post to clean up the thread. Do note that some of those Plugins will cause you issues, but I'm confident you have the skills to identify them without anyone's help.
Don't worry, many of the plugins are edited by me to function in.

Game works perfect now. I just need to figure out how to do APK Expansion Files for my game since my game's over 300 MB even after compressing all of the lights.
 

Xilefian

Adventurer
Xy$
0.00
Don't worry, many of the plugins are edited by me to function in.

Game works perfect now. I just need to figure out how to do APK Expansion Files for my game since my game's over 300 MB even after compressing all of the lights.
I've been talking to a couple of people about APK Expansion Files. It's definitely possible, but requires actual code changes and complicates things a fair bit. https://developer.android.com/google/play/expansion-files.html

One day I will probably add APK Expansion support to the MV Android Client itself. I think it would be a pretty neat model to have the entire MV game in the APK Expansion OBB but the MV Android Client is a thin client. Unfortunately APK Expansions depend on Google Play deployment, which is why I'm apprehensive about approaching it (I'm not willing to provide commercial support or risk any legal hot-water involved here).

Best case scenario is that a studio funds me to specifically add APK Expansion support for their project and the code gets carried over into the MV Android Client. For the time being though, see if you can follow the guide linked above to write the Java code and produce the OBB file yourself or find a developer that is willing to do it for you.

If my studio's current project gains an Android deployment target, then I'll be adding the support myself in the future (much in the future, I'm afraid).
 

DragonX7

Villager
Xy$
0.00
i followed every instruction in the tutorial. great job by the way, really simple to use. when building as webviewDebug, the app installs but i get the WebGL error as mentioned in this thread. i may be missing something as there are 11 pages to this, but i am having a problem. i tried as crosswalk, but the app wouldn't build. any suggestions?
 

Xilefian

Adventurer
Xy$
0.00
Good day Xilefian. I have a question here.
How to handle this error. please and thanks.

LOVE YOU!
For some reason you decided to add extra lines to this file. Don't do that.

See how lines 52, 53 and 54 in this link here are all on their own lines? https://github.com/AltimitSystems/mv-android-client/blob/master/app/build.gradle#L51

For some reason you decided to split the lines (52, 53, 54, 55, 56, 57 and 58 in the image you posted).


Please don't modify any of the source files unless you know exactly what you're doing. The tutorial will describe where and how you can modify the files safely without creating these kind of problems.
 

Crynx Ryner

Villager
Xy$
0.00
For some reason you decided to add extra lines to this file. Don't do that.

See how lines 52, 53 and 54 in this link here are all on their own lines? https://github.com/AltimitSystems/mv-android-client/blob/master/app/build.gradle#L51

For some reason you decided to split the lines (52, 53, 54, 55, 56, 57 and 58 in the image you posted).


Please don't modify any of the source files unless you know exactly what you're doing. The tutorial will describe where and how you can modify the files safely without creating these kind of problems.

havent modidied the lines. when I uploaded them to android. it directly says error for that.
thanks.
 

Xilefian

Adventurer
Xy$
0.00
You have an invalid build variant there (debug). The only valid variants are webviewDebug and z_crosswalkDebug, so this suggests that you imported the project incorrectly.

You should delete this project, re-extract the Zip and import it again. Check the tutorial to make sure you're importing the correct folder.
 

Crynx Ryner

Villager
Xy$
0.00
You have an invalid build variant there (debug). The only valid variants are webviewDebug and z_crosswalkDebug, so this suggests that you imported the project incorrectly.

You should delete this project, re-extract the Zip and import it again. Check the tutorial to make sure you're importing the correct folder.

I'll try that :) thanks
 
First off, thank you tons for this tutorial, I was able to get my game on to the Google Play store which i am very happy about. I just have a question you may or may not be able to answer. I am trying to implement ads using Google adMob, I created an xml layout file in which I set the location of the banner, then in the WebPlayerActivity java file I added in the necessary code under onCreate and linked it to my xml layout. I get no errors and the game still runs smoothly on my phone but no ads. Any ideas?
 

leboon

Villager
Xy$
0.00
Hello Xilefian,

Thank you very much for your great work.

I have a small problem. The music of the combat and the cover are never heard. I know it's not a problem with my phone or the audio format because I tried to change it to the allowed formats and had the same problem. (https://developer.android.com/guide/topics/media/media-formats)

It simply does not load any audio from the BGM folder.

For example, if a sound that is heard in the apk of the SE folder (for example Desicion1) is copied to the BGM folder as combat music or the cover (I rename it as Theme6), it is never heard in apk but in pc I can heard as music the cover o combat.

What could be the problem?
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
Hello Xilefian,

Thank you very much for your great work.

I have a small problem. The music of the combat and the cover are never heard. I know it's not a problem with my phone or the audio format because I tried to change it to the allowed formats and had the same problem. (https://developer.android.com/guide/topics/media/media-formats)

It simply does not load any audio from the BGM folder.

For example, if a sound that is heard in the apk of the SE folder (for example Desicion1) is copied to the BGM folder as combat music or the cover (I rename it as Theme6), it is never heard in apk but in pc I can heard as music the cover o combat.

What could be the problem?
Are you using MV1.6 or higher?
I had a similar issue and after updating to MV1.6+ the music & sounds all work smoothly now.
Not sure if this will help in your case or not but that's what helped me. (cute)

There are other ways around the issue but that was the best I found. (cool)(thumbsup)
If nothing else works I think before I used something like this:
https://alvinalexander.com/java/java-audio-example-java-au-play-sound

@Xilefian ...any extra info on this?
 

leboon

Villager
Xy$
0.00
Are you using MV1.6 or higher?
I had a similar issue and after updating to MV1.6+ the music & sounds all work smoothly now.
Not sure if this will help in your case or not but that's what helped me. (cute)

There are other ways around the issue but that was the best I found. (cool)(thumbsup)
If nothing else works I think before I used something like this:
https://alvinalexander.com/java/java-audio-example-java-au-play-sound

@Xilefian ...any extra info on this?
If I were a woman I would ask you for a marriage. I love you.
I spent 4 days looking for the solution until I wrote here. Update to Beta has solved it. Thank you very much. THANKS!!! Thanks again!!!!!!
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
If I were a woman I would ask you for a marriage. I love you.
I spent 4 days looking for the solution until I wrote here. Update to Beta has solved it. Thank you very much. THANKS!!! Thanks again!!!!!!
Ahahahahaha, lol. No problem! Glad to help out. (hella)(thumbsup)
I've still been looking into what the root cause of the issue was...
...but I guess it don't really matter much now as long as everything is working smoothly. (jolly) lol
 

draco

Villager
Xy$
0.00
Hi!

I have found another problem with the APK.

When i run the application, I see my Title screen during 1-2 seconds and after some flash, he becomes black, a black screen.

I have see this problem in some different APK, like in this page : https://forums.rpgmakerweb.com/index.php?threads/android-black-screen-4-4-4-api-19.83432/ .

The application run and don't crash, but we have a permanently black screen.
But the mobile device works, we can see notifications, or quit the game.

I used an Android, a Samsung Galaxy J3 320FN, with ROM (So an Android 7.1.2) before it was a Android 5.1 (And i had the same problem, with the both version), but I don't know what could be the problem.


Thanks for your help!
 

firecat

Villager
I really want to think this is working and its just my phone/tablet that is broken but even after building it on android bundle (you can read more here: https://developer.android.com/platform/technology/app-bundle/) I do think something major is worng with this. Yes i'm 100% sure that my games does run on android, i used another program that makes html into android apk. So i know my game is playable/buildable but when it comes to using it with this code even with google's help to 100% optimize the app to run on systems, it still can't run.

i thought it be something to share, the number 1 thing i know that will run it is having a embulator. all other test done with google firebase and amazon has proven that it can not run in simple phones/tablets.
 

Xilefian

Adventurer
Xy$
0.00
Thanks for keep working on this! Just curious, I saw that you have been updating quite a bit. But I did not find a detailed change log. Was this quota problem solved in recent update?
https://rpgmakermv.co/threads/quota-exceeded-error-for-android-deployment.8305/#post-47273
Haven't updated it in quite a while, however whilst a fix SPECIFIC to your error hasn't been made (it's an issue with WebView limitations that desktop deployments don't care about, not my code), a feature has been added that gives you a way to fix it via a Plugin.

We've added the ability to write API extensions: https://github.com/AltimitSystems/mv-android-client/issues/2

One such extension is "libandroidapi" which adds the ability to access the Android local storage system features in the same way as include( 'fs' ). I made a test Plugin that very simply detects MV Android Client and then uses libandroidapi for the storage rather than WebStorage.
Code:
var afs = androidRequire( 'fs' );

var fileText = afs.readFileSync( '/path/file.txt' );
afs.writeFileSync( '/path/out.txt', "Hello, world!" );
It is not complete, however it contains absolutely everything needed to replace the WebStorage save system with Android's via a Plugin. Due to the requirement of external storage, this will not let you read/write to SD storage. You'll have to create an extension for that, but it shouldn't be too difficult as you could just copy the libandroidapi implementation then add everything you need for permission handling.
 
Top