Android Deployment - How to check an Error?

Status
Not open for further replies.

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,707
Reaction score
1,123
First Language
Portuguese - Br
Primarily Uses
RMMZ
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?
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
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.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
@?????? 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.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
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. :(
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Oftentimes prople forget that SRD's game upgrade plugin is only for PCs. That might be the issue.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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?
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
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 :D

side note: good to see you with a blue name shaz, seems strange to me :D
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
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).
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,707
Reaction score
1,123
First Language
Portuguese - Br
Primarily Uses
RMMZ
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.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
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 :)
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,707
Reaction score
1,123
First Language
Portuguese - Br
Primarily Uses
RMMZ
It's working guys!
The problem is only the srdcompressor plugin. I just remove it!
Thanks for all the help!
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,370
Reaction score
8,547
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,191
Members
137,772
Latest member
Kirakirna
Top