Search code examples
androidgoogle-castchromecast

Chromecast app starting from sample TicTacToe - failed to start application: request failed


I have a whitelisted URL for my Chromecast and I'm able to install and run the sample TicTacToe app using the code out of the box. But when I switch "TicTacToe" to my app id, I get this in LogCat:

StartApplicationRequest failed with status: -4
StartSessionTask failed with error: failed to start application: request failed
start session failed: failed to start application: request failed

I have looked through many SO questions where people failed to get their own App Id's working, but those solutions have not solved my issue. For instance, https://stackoverflow.com/a/17916608/1399483 Also, Google emailed telling me they messed up the app id the first time, and so they sent me a new id. I am using it.

Changes I've made:

First, in GameActivity I changed

    try {
        mSession.startSession("TicTacToe");
    } catch (IOException e) {
        Log.e(TAG, "Failed to open a session", e);
    }

to

    try {
        mSession.startSession("<the new app id from Google>");
    } catch (IOException e) {
        Log.e(TAG, "Failed to open a session", e);
    }

Then in TicTacToe.html I changed

      var chromecastApp = new cast.receiver.Receiver("TicTacToe",
      [ cast.TicTacToe.PROTOCOL ], "", 5);

to

      var chromecastApp = new cast.receiver.Receiver("<the new app id from Google>",
      [ cast.TicTacToe.PROTOCOL ], "", 5);

So when starting from the sample code - including the sender and receiver - how many total changes need to be made, and in which files? Am I missing some? If not, then I'll go back to Google to see if something still got messed up.


Solution

  • Turns out I typed in my serial number incorrectly. After an email to the guys at Google and a very quick reply(thanks Les), things are up and running.

    So, to answer the question for those who come after me, the 2 changes I made and pointed out in my question are all it takes to get things working with your own app ID. If things aren't working with those changes, let Google know and they can look into whether you submitted your web form incorrectly, etc.

    My 2 suggestions for Google:

    1. Please make those serial numbers more easily readable
    2. Maybe send an email to the developer when the web form is submitted so that she/he can double check what was submitted