0

I made a game with Unity3D which is working on my own android phone fine, but it seems not working on other phones. I don't have access to those phones, but this is what I was told.

More detail: My game is an android app and needs to send data to a server to be stored. The URL is something like this "https://example.com/register". The server is hosted on the google app engine. When a user attempts to send the data he gets an error back which is something like this "java.io.FileNotFoundException https://example.com/register". I checked the logs in my server, there is no record regarding a request from that user. I read somewhere that it's because of htaccess and WWW class and you can't call an URL with htaccess data in it! But there is no htaccess to that page in my server. The page simply receives the data and store them, no authentication needed.

Would be great if anyone has any other idea why some devices get this error and some don't.

string url = "https://my-app-name.appspot.com/register";

WWWForm form = new WWWForm();
form.AddField("playerEmail", playerEmail);
form.AddField("registrationId", registrationId);
form.AddField("playerName", playerName);
form.AddField("playerPass", playerPass);

WWW www = new WWW(url, form);
yield return www;

the server-side then use those provided data and return a simple string.

<?php
$player_name = $_POST['playerName'];
$player_pass = $_POST['playerPass'];
$player_email = $_POST['playerEmail'];
$gcm_registration_id = $_POST['registrationId'];

//store data in the Datastore.

echo "success";
?>

app.yaml

application: my-app-name
version: 1
runtime: php55
api_version: 1
threadsafe: false

handlers:
- url: /register
  script: register.php
4
  • can u post the actual URL you are passing. Commented May 28, 2015 at 10:23
  • It would be nice to see the code block(s) reponsible for this. Sounds like the device may be trying to locate the resource on disk rather than visit a URL. Possible URI issue? Commented May 28, 2015 at 10:41
  • @Akash please see the next comment :) Commented May 28, 2015 at 13:45
  • @AtraViator string url = "https://my-app-name.appspot.com/register"; Commented May 28, 2015 at 13:45

1 Answer 1

1

I also had this problem. The takeaway I had was

  1. Java.io.filenotfound exception is bogus error. It's not anything to do with file io - it's the request failing at the server.

  2. To find the actual error in unity - look at the www requestHeaders - this will give you back the response headers from the request from the server - mine was a 500, but it could be a 400+ type error (especially if you're using authentication).

You can do this by doing a

foreach(var header in request.responseHeaders) ....

If anyone wants I can post my diagnostic code to help out.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.