Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

404 Error when running TicTacToe sample (Android) against sample Google App Engine project (Java)

I set up the Android App and Google App Engine backend as seen in these two projects:

  1. Android Connected App Engine Project
  2. Java App Engine Backend Project

When I click a TicTacToe-field button, which triggers a request I get an 404 error: "Not found"

04-09 23:11:51.115: W/TicTacToe(26247): GetComputerMoveTask: 404 Not Found
04-09 23:11:51.115: W/TicTacToe(26247): Not Found

That is exactly the what https://myappname.appspot.com/_ah/api/ in the browser shows "Not Found".

Here is what I did:

  1. Created an api project on App Engine Console
  2. There created an Android Client Id with com.google.devrel.samples.ttt as package an my debug keys SHA1-fingerprint
  3. There created a Web Client ID
  4. Integrated the Android Project in eclipse. Updated DEFAULT_ROOT_URL in Tictactoe.java to "https://myappname.appspot.com/_ah/api/"
  5. There updated the value of AUDIENCE in ClientCredentials.java by replacing the string "your_web_client_id" with the generated web-client-id from step 3
  6. Integrated the Java backend project in eclipse.There updated the value of application in appengine-web.xml to myappname
  7. Updated the values in /spi/Ids.java to reflect the web-client-id and android-client-id from step 2 and 3
  8. Updated the value of google.devrel.samples.ttt.CLIENT_ID in war/js/render with web-client-id
  9. Deployed the backend to google. Worked great - it opend the https://myappname.appspot.com/ page showing the correct page after deploying (servlet)
  10. Deployed the android app and tried to make a move in TicTacToe. The app crashes.

I think its very suspicious my DEFAULT_ROOT_URL is set to "https://myappname.appspot.com/_ah/api/" in my Android app whereas this pages show just "Not found" in the browser.

Whats going wrong here?

Thanks in advance

like image 229
softwaresupply Avatar asked Nov 01 '22 07:11

softwaresupply


1 Answers

Try to test your API at https://your_app_id.appspot.com/_ah/api/tictactoe/v1/ and see if that doesn't do what you want.

Research from this link:https://github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-android/blob/master/app/src/main/java/com/google/api/services/tictactoe/Tictactoe.java

Lines 60-74

https://github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-java/blob/master/src/com/google/devrel/samples/ttt/spi/BoardV1.java

Lines 29-31

I suspect you have the API URL wrong, and diving in the code its apparent that the above URL is correct.

like image 177
AndrewF Avatar answered Nov 11 '22 07:11

AndrewF