I have a working local web server, I tested it with the preview in GDevelop5, everything worked, the answer came and was recorded, but when I decided to export the application to android, the answers stopped coming (from the web server) in the browser on the computer everything works, there is an answer, there is also a response from the server in the preview in where the developer is and it is written to the Text variable, it works in the browser on the phone, but in the exported application - no, I hope if I did something wrong, they will help me, or if this bug will be fixed …
this is a browser on pc
this is a preview in gdevelop5
this is a request event
these are scene events
this is the browser on the phone (android)
and this is a mobile application on android, you can notice that instead of the expected response from the 12345 server, we see 0.
the red squares in the screenshots indicate a response from the server.
Try to move the modify text action in a separate event, with a condition to wait until the data has been received (the variable has changed).
Also, you can probably check the logs of your web server to confirm that the GET request is received.
Is it possible your mobile device is using mobile data when using the exported version of the game?
It may be using local wifi in the browser version and mobile data in the exported version… whether that’s an issue with the phone settings or gdevelop I can’t say, but if your phone is using mobile data it will not be able to contact the server on your local network unless you’ve configured port forwarding/RDNS at your gateway/router.
I recommend you go into airplane mode/deactivate your phone’s data, make sure that your only connection is wifi and test again. Another possibility would be to set up your system on a free webhost and see it runs.
1.Where and how to view the error variable?
2.POST is written to .txt so I understand that the parameter came, when I send from the phone, nothing happens, my server is working correctly, the error is either in my code in the GD or in the GD itself
Looking at your events you have no variable storing the response, it looks like just double quotes (""). The error message is stored in the variable “Text”. To view the error message use a text object and set its value to VariableString(Text).
I don’t think so, because you have to accept the certificate to that server before you try to connect through the cordova app. If the server is available on the internet, you could try to get a free certificate from here: https://letsencrypt.org/
Hello everyone, the problem was solved, it was that the exported application to the android did not send the http request, the decision to transfer the server to https, thank you all, you can close the topic, I also recommend that the GD team make edits to the wiki about the network, stating that the http does not work on phone, thanks.