Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法隐式转换类型';Xamarin.Auth.OAuth2Authenticator';至';Google.api.Http.IConfigurableHttpClientInitializer';_Android_Xamarin.ios_Xamarin_Oauth 2.0 - Fatal编程技术网

Android 无法隐式转换类型';Xamarin.Auth.OAuth2Authenticator';至';Google.api.Http.IConfigurableHttpClientInitializer';

Android 无法隐式转换类型';Xamarin.Auth.OAuth2Authenticator';至';Google.api.Http.IConfigurableHttpClientInitializer';,android,xamarin.ios,xamarin,oauth-2.0,Android,Xamarin.ios,Xamarin,Oauth 2.0,我正在尝试使用google drive服务,提供流畅的代码和身份验证 var auth = new OAuth2Authenticator ( clientId: xxxxxxxx scope: "https://www.googleapis.com/auth/drive", authorizeUrl: new Uri ("https://accounts.google.com/o/oauth2/auth"), redirectUrl: new Uri ("myredirect:oob"));

我正在尝试使用google drive服务,提供流畅的代码和身份验证

var auth = new OAuth2Authenticator (
clientId: xxxxxxxx
scope: "https://www.googleapis.com/auth/drive",
authorizeUrl: new Uri ("https://accounts.google.com/o/oauth2/auth"),
redirectUrl: new Uri ("myredirect:oob"));
并尝试通过以下方式初始化google drive服务:

var service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = auth,
ApplicationName = "Google Drive API Sample",
});
但上面的代码显示了一个错误 错误CS0266:无法将类型“Xamarin.Auth.OAuth2Authenticator”隐式转换为“Google.api.Http.IConfigurableHttpClientInitializer”。存在显式转换(是否缺少转换?)(CS0266)