【发布时间】:2017-06-11 06:38:22
【问题描述】:
我正在尝试构建一个实现 Google Sheets api 的 Android 应用程序;但是,当我尝试创建用户凭据时,我收到一条错误消息,指出浏览器无法启动。我该如何解决这个问题?
这是我的代码:
async Task Run()
{
UserCredential credential;
ClientSecrets secrets = new ClientSecrets();
secrets.ClientId = "465415811596-mqm04akgc7vhgil05hog8blvm2ns6he1.apps.googleusercontent.com";
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
secrets,
new[] { SheetsService.Scope.Spreadsheets},
"user", CancellationToken.None
);
Console.WriteLine("Accessing Google Web Systems");
var service = new SheetsService(new BaseClientService.Initializer()
{
//HttpClientInitializer = credential,
ApplicationName = "budget_application"
});
}
我相信我已经通过控制台正确设置了 api,因为当我通过我的计算机而不是我的 android 调试运行这段代码时,它工作正常。
谢谢!
【问题讨论】:
标签: android debugging exception google-sheets-api build-error