iOS应用获得"设备身份验证错误"扫描Chromecast设备时

时间:2015-01-08 01:43:32

标签: ios iphone chromecast google-cast

我正在使用适用于Chromecast的iOS发件人应用。我设置了两个Chromecast设备,并且能够检测并连接到这两个设备,直到我切换到其他测试iPhone,现在当我尝试扫描Chromecast设备时,从未发送deviceDidComeOnline消息。

我可以使用GoogleCast框架2.5.1版的示例应用here重现问题。以下是示例应用程序无法检测到Chromecast时的控制台输出:

2015-01-17 07:52:37.314 CastVideos[411:33216] Start Scan
2015-01-17 07:52:37.315 CastVideos[411:33216] -[GCKDeviceScanner startNetServiceScan]  startNetServiceScan
2015-01-17 07:52:37.341 CastVideos[411:33216] -[GCKNetworkReachability updateStatus]  updateStatus
2015-01-17 07:52:37.345 CastVideos[411:33216] -[GCKDeviceScanner networkReachabilityStatusDidChange:]  networkReachabilityStatusDidChange:1
2015-01-17 07:52:37.345 CastVideos[411:33216] -[GCKDeviceScanner purgeAllOnlineDevices]  purgeAllOnlineDevices
2015-01-17 07:52:37.489 CastVideos[411:33216] -[GCKDeviceScanner startFilteringDevice:]  starting filter for device: <0x1780b0b60:GCKDevice> ChromecastDev2 (be1be9dcbaa4cb82678b977203c3ef91)
2015-01-17 07:52:37.494 CastVideos[411:33216] -[GCKDeviceScanner startFilteringDevice:]  starting filter for device: <0x1700a38a0:GCKDevice> ChromecastDev (3df5a88f22a974661a8a3556acafdd2f)
2015-01-17 07:52:37.629 CastVideos[411:33216] -[GCKCastSecureSocket continueHandshake]  Peer trust certificate invalid; disconnecting
2015-01-17 07:52:37.630 CastVideos[411:33216] -[GCKCastSecureSocket doTeardownWithErrorCode:]  doTeardownWithErrorCode:3
2015-01-17 07:52:37.630 CastVideos[411:33216] __42-[GCKCastSecureSocket initWithBufferSize:]_block_invoke18  Error reading from SSL buffer to stream buffer, status: -50
2015-01-17 07:52:37.630 CastVideos[411:33216] -[GCKCastSecureSocket doTeardownWithErrorCode:]  doTeardownWithErrorCode:1
2015-01-17 07:52:37.631 CastVideos[411:33216] -[GCKDeviceManager castSocket:didDisconnectWithError:]  castSocket:didDisconnectWithError:Error Domain=com.google.GCKError Code=3 "Device authentication failure" UserInfo=0x170272180 {NSLocalizedDescription=Device authentication failure}
2015-01-17 07:52:37.631 CastVideos[411:33216] -[GCKDeviceManager handleConnectionError:]  handleConnectionError error=Error Domain=com.google.GCKError Code=3 "Device authentication failure" UserInfo=0x170272180 {NSLocalizedDescription=Device authentication failure}, _appConnectionState=0
2015-01-17 07:52:37.631 CastVideos[411:33216] -[GCKDeviceManager handleConnectionError:]  giving up on reconnect; _pausedAppID=(null), _wasConnected=0
2015-01-17 07:52:37.632 CastVideos[411:33216] -[GCKDeviceManager unregisterForAppStateNotifications]  unregisterForAppStateNotifications
2015-01-17 07:52:37.634 CastVideos[411:33216] -[GCKDeviceManager disconnectWithError:isExplicit:]  disconnectWithError:(null)
2015-01-17 07:52:37.634 CastVideos[411:33216] -[GCKDeviceScanner filteringFailedForDevice:withError:]  Filter failed for device <0x1700a38a0:GCKDevice> ChromecastDev (3df5a88f22a974661a8a3556acafdd2f) with error Error Domain=com.google.GCKError Code=3 "Device authentication failure" UserInfo=0x170272180 {NSLocalizedDescription=Device authentication failure}
2015-01-17 07:52:37.634 CastVideos[411:33216] -[GCKDeviceScanner filteringFailedForDevice:withError:]  Marking device <0x1700a38a0:GCKDevice> ChromecastDev (3df5a88f22a974661a8a3556acafdd2f) invalid
2015-01-17 07:52:37.635 CastVideos[411:33216] -[GCKDeviceManager unregisterForAppStateNotifications]  unregisterForAppStateNotifications
2015-01-17 07:52:37.635 CastVideos[411:33216] -[GCKDeviceManager disconnectWithError:isExplicit:]  disconnectWithError:(null)
2015-01-17 07:52:37.635 CastVideos[411:33216] -[GCKCastSecureSocket disconnectWithError:]  disconnect

这是在运行iOS 8.0的iPhone 6+上发生的。当我在此手机上打开其他Chromecast兼容应用(Chromecast,YouTube)时,会成功检测到两个Chromecast设备。它只是我从Xcode运行的应用程序,只是在这个特定的测试手机上,似乎有这个问题。

我在其他几个测试设备上尝试了相同的示例应用程序,看它是否与设备/操作系统有关。在以下iPhone / iPad上检测到两个Chromecast设备都没有问题:

  • iOS 8.1.2上的iPhone 6
  • iOS 8.1.2上的iPhone 5
  • iOS 8.0.2上的iPhone 6+
  • iOS 8.0上的iPhone 5
  • iOS 8.0上的iPad Air

任何想法会导致什么? 提前谢谢。

3 个答案:

答案 0 :(得分:2)

证书问题可能是由手机上的无效日期引起的。检查日期时间是否正确,因为这可能会导致证书问题,然后是Chromecast问题

答案 1 :(得分:0)

显然我使用的iPhone有证书问题。

转到设置 - &gt;常规 - &gt;重置 - &gt;重置所有设置解决了问题。 起初我尝试重置网络设置,但这似乎没有帮助。不确定两者的结合是否也是它的组合。

答案 2 :(得分:0)

当设备上的时间和时间不正确时,我遇到了这种情况。

当我更正其按预期工作的日期时。