Android Deployment - How to check an Error?

Hi people!

I'm trying to put a game on the play store.
But when i finished, i open the app and he shows an error

"ReferenceError
require is not defined"

In the Desktop version i just push the F8 or F12 and i see the detailed error.

How can i do that in android? There are any plugin that can make i see the detailed error on screen?
lol thats funny.

google chrome has developer tools that you may be able to use to properly debug the app. its worth looking into.

However, I can tell you - one of your plugins is doing a 'require' call (pretty sure default mv does a few via the nw.js engine - but thats for desktop deployment) and your android device isnt able to process that.
@?????? Actually, android Chrome doesn't have developer tools. Also, on android it uses built-in browser on the device, not Chrome.
The only way to do that would be to transform the console.error to alert or something.
You can use chrome dev tools on your pc with your android device plugged in - in developer mode, and you get the debug reporting for the webview within the android app on your pc - I do it often. 😉

Problem remains though, a script is requiring where it cant. 🙁
Oftentimes prople forget that SRD's game upgrade plugin is only for PCs. That might be the issue.
You can use chrome dev tools on your pc with your android device plugged in - in developer mode, and you get the debug reporting for the webview within the android app on your pc - I do it often
That sure sounds to me like a tutorial just waiting to happen! Pretty please?
I'm actually recording a tutorial right now for something else (arduino related). Perhaps I will grant your request and do a tutorial for that next 😀

side note: good to see you with a blue name shaz, seems strange to me 😀
As stated by others, but adding a little more info:
The require call is used in NodeJS to include modules. They key point there is that it's meant for use only in the desktop deployments of MV which use NW.js.

From the NW.js website:
NW.js (previously known as node-webkit) lets you call all Node.js modules directly from DOM

MV uses this to access the NodeJS 'fs' (filesystem) module when saving the game, because savefiles are written to disk. On mobile/web browser games the savefile is written to localstorage and so doesn't need any NodeJS modules.

The cause might be a plugin that's using the 'fs' module to read or write (SRD plugins come to mind as Poryg said), a plugin that uses ANY NodeJS module, or if somehow a plugin messed with the function that checks whether it's a NW.js deployment or not (I think it's Utils.isNwJs).
Hello people!
Thanks for all the answers!
I found the Olivia Anti-Stress plugin that does this detailed debug! I'll test it now.
You can use chrome dev tools on your pc with your android device plugged in - in developer mode, and you get the debug reporting for the webview within the android app on your pc - I do it often. 😉

Problem remains though, a script is requiring where it cant. 🙁
Hi! @??????
I have no idea how to do this ... I mean, I've already tried doing something similar using Android Studio. I enabled debug mode on my phone and tried using Android Studio, but I could not make it work.
As Shaz said, I think it's worth a tutorial xD

Oftentimes prople forget that SRD's game upgrade plugin is only for PCs. That might be the issue.
Maybe that's the problem. I am currently using the following:
SrdGameUpgrade
SrdPreloader
Srd Translation Engine
Srd Compress Data

In the GameUpgrade I changed a small part of the code, turning it into comments. Parts so that it does not touch the screenSize and also not to do the update of the package.json that it does.
I only use it to use Preloader. But maybe I should discard it and just stay with Chaucer's SceneStabilizer.
However I would like to make it works because in other projects I would like to use HUDMAKER and SUPER TOLLS that also need the gameupgrade.
I'm going to do some more tests and see if that's really the problem, because I've already been able to do APK and everything works fine. Only this time I put it in the Play Store that did not work when I downloaded the game from the store.

As stated by others, but adding a little more info:
The require call is used in NodeJS to include modules. They key point there is that it's meant for use only in the desktop deployments of MV which use NW.js.

From the NW.js website:


MV uses this to access the NodeJS 'fs' (filesystem) module when saving the game, because savefiles are written to disk. On mobile/web browser games the savefile is written to localstorage and so doesn't need any NodeJS modules.

The cause might be a plugin that's using the 'fs' module to read or write (SRD plugins come to mind as Poryg said), a plugin that uses ANY NodeJS module, or if somehow a plugin messed with the function that checks whether it's a NW.js deployment or not (I think it's Utils.isNwJs).

That's make a lot of sense when i read my answer for poryg above xD.
Well, i will make another tests to see if i can make it. Because when i made the apk and transfer it to my phone, it works. But when i put in play store and download it from there, this problem happens.
thats even stranger, as the version you download from the player store is identical to the one you upload to them (heres assuming it would be the same version)

And yea, I'll try get some time later tonight or tomorrow to smash out a tutorial for it 🙂
It's working guys!
The problem is only the srdcompressor plugin. I just remove it!
Thanks for all the help!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/android-deployment-how-to-check-an-error.108632/