从样本TicTacToe开始的Chromecast应用程序 - 无法启动应用程序:请求失败

时间:2013-08-05 20:49:59

标签: android google-cast chromecast

我的Chromecast有一个列入白名单的网址,我可以使用开箱即用的代码安装和运行示例TicTacToe应用。但是当我将“TicTacToe”切换到我的应用程序ID时,我在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

我已经查看过许多人们未能让自己的App Id工作的问题,但这些解决方案并没有解决我的问题。例如,https://stackoverflow.com/a/17916608/1399483此外,谷歌通过电子邮件告诉我他们第一次搞砸了应用ID,所以他们给了我一个新的身份证。我正在使用它。

我所做的改变:

首先,在GameActivity中我改变了

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

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

然后在TicTacToe.html中我改变了

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

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

因此,当从示例代码开始 - 包括发送方和接收方 - 需要进行多少总更改,以及在哪些文件中?我错过了一些吗?如果没有,那么我会回到谷歌看看是否还有一些事情搞砸了。

2 个答案:

答案 0 :(得分:1)

原来我错误输入了我的序列号。在收到谷歌人员的电子邮件和非常快速的回复后(感谢Les),事情已经开始并且正在运行。

所以,为那些追随我的人回答问题,我在我的问题中做出的两项更改都是使用您自己的应用ID进行操作所需的全部内容。如果这些更改无法解决问题,请告知Google,他们可以查看您是否错误地提交了您的网络表单等。

我对Google的两条建议:

  1. 请使这些序列号更易于阅读
  2. 也许在提交网络表单时向开发人员发送电子邮件,以便他/她可以仔细检查提交的内容

答案 1 :(得分:-1)

在文件README_ECLIPSE.txt中,它说:

In GameActivity at line 91, the code makes a call to the app name "TicTacToe". 
This is a whitelisted app name at which the TicTacToe receiver is located, 
so you can simply build and run the app without worrying about whitelisting 
your own receiver.

所以请不要更改示例代码中的任何内容(替换为AppId),只需构建并运行以查看它是否适合您。

如果你无法做到这一点,请在这里查看答案:

Unable to debug Whitelisted device / ApplicationSession failing to start