저는 YouTube Data API를 사용하여 YouTube 검색을 표시하는 Xamarin에 페이지를 작성하고 있습니다. 그것은 잘 컴파일하지만 안드로이드 장치에서 실행하면 잠시 후 잠시 응답하지 않기 때문에 응용 프로그램을 종료하라는 메시지가 나타납니다. YouTubeService 객체를 설정하는 것과 관련이 있다고 생각합니다.async 작업 시간 초과
이 기본적으로 목록보기 또한
private async Task Run()
{
videoList.Clear();
var youtubeService = new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = DEVELOPER_KEY,
ApplicationName = "Xamarin-Basics"
});
var searchListRequest = youtubeService.Search.List("snippet");
searchListRequest.Q = "mkbhd";
searchListRequest.MaxResults = 50;
var searchListResponse = await searchListRequest.ExecuteAsync();
foreach(var searchResult in searchListResponse.Items)
{
if (searchResult.Id.Kind.Equals("youtube#video"))
{
videoList.Add(new VideoInfo(searchResult.Snippet.Title, searchResult.Snippet.Description));
}
}
}
에 데이터 API로드 주어진 검색어에 대한 비디오 (50)를 호출, 여기 스레드에서 작업을 실행하고있는 것으로 보인다 스택 추적입니다 다시 :
09-15 20:31:21.352 D/Mono (6831): Assembly Ref addref Newtonsoft.Json[0xb72c8210] -> System.Linq.Expressions[0xb72e98a0]: 3
Loaded assembly: Anonymously Hosted DynamicMethods Assembly [External]
09-15 20:31:21.562 D/Mono (6831): Assembly Ref addref Google.Apis.YouTube.v3[0xb72c7310] -> Newtonsoft.Json[0xb72c8210]: 4
09-15 20:31:22.127 D/Mono (6831): DllImport searching in: '__Internal' ('(null)').
09-15 20:31:22.127 D/Mono (6831): Searching for 'CloseZStream'.
09-15 20:31:22.127 D/Mono (6831): Probing 'CloseZStream'.
09-15 20:31:22.127 D/Mono (6831): Found as 'CloseZStream'.
09-15 20:31:31.950 D/Mono (6831): [0xb76fa5b0] worker finishing
Thread finished: <Thread Pool> #3
The thread 'Unknown' (0x3) has exited with code 0 (0x0).
09-15 20:31:57.148 D/Mono (6831): [0xb808e9b8] worker finishing
Thread finished: <Thread Pool> #7
The thread 'Unknown' (0x7) has exited with code 0 (0x0).
09-15 20:32:04.446 D/Mono (6831): [0xb77219d8] worker finishing
Thread finished: <Thread Pool> #4
The thread 'Unknown' (0x4) has exited with code 0 (0x0).
Thread finished: <Thread Pool> #2
The thread 'Unknown' (0x2) has exited with code 0 (0x0).
09-15 20:32:49.051 D/Mono (6831): [0xb808de40] worker finishing
Thread finished: <Thread Pool> #8
The thread 'Unknown' (0x8) has exited with code 0 (0x0).
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
09-15 20:32:59.725 D/Mono (6831): [0xb81d8738] worker starting
09-15 20:33:30.573 D/Mono (6831): [0xb81d8738] worker finishing
Thread finished: <Thread Pool> #12
The thread 'Unknown' (0xc) has exited with code 0 (0x0).
09-15 20:33:46.394 D/Mono (6831): [0xb80a4790] worker finishing
Thread finished: <Thread Pool> #9
The thread 'Unknown' (0x9) has exited with code 0 (0x0).
Thread finished: <Thread Pool> #11
The thread 'Unknown' (0xb) has exited with code 0 (0x0).
Thread started: <Thread Pool> #13
Thread started: <Thread Pool> #14
09-15 20:34:39.731 D/Mono (6831): [0xb81d8738] worker starting
Thread started: <Thread Pool> #15
09-15 20:34:39.749 D/Mono (6831): [0xb84d0f60] worker starting
09-15 20:34:52.494 D/Mono (6831): [0xb84d0f60] worker finishing
Thread finished: <Thread Pool> #15
The thread 'Unknown' (0xf) has exited with code 0 (0x0).
당신이 유튜브 DLL의 버전이 있습니까? – DaImTo
버전 3은 내가 가진 것입니다 –