我正在使用 Google 驱动器来允许服务器访问我的驱动器。我使用 SignIn 为传递给它的服务器获取 token ,以便它可以访问驱动器。
我可以正常登录该应用程序,它请求相应的云端硬盘权限。
问题是当我撤销我之前授予使用登录权限的应用程序访问云端硬盘时崩溃。
*** -[GSDK_GTMSessionFetcherService fetcherWithRequest:]: message sent to deallocated instance 0x7ff2706c8440
知道是什么导致了这种情况发生。我找不到解决方案。由于 pod 将代码作为框架分发,因此我无法轻松使用该代码。
我使用的是 GoogleSignIn 4.0.0
这是崩溃期间的堆栈跟踪。
2016-08-30 12:28:10.485 MyAPP [68739:3873962] CRASH: -[__NSCFType fetcherWithRequest:]: unrecognized selector sent to instance 0x7fcb28475580
2016-08-30 12:28:10.486 MyAPP [68739:3873962] Stack Trace: (
0 CoreFoundation 0x0000000107fe3d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107615deb objc_exception_throw + 48
2 CoreFoundation 0x0000000107fecd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107f32cfa ___forwarding___ + 970
4 CoreFoundation 0x0000000107f328a8 _CF_forwarding_prep_0 + 120
5 MyAPP 0x0000000101e89a9e -[GSDK_GTMOAuth2Authentication beginTokenFetchWithDelegate:didFinishSelector:] + 768
6 MyAPP 0x0000000101cc2307 +[GIDTokenFetchDelegate beginTokenFetchWithAuth:handler:] + 126
7 MyAPP 0x0000000101cbb15a -[GIDSignIn maybeFetchToken:fallback:] + 615
8 MyAPP 0x0000000101cba9dc -[GIDSignIn clearAndAuthenticateWithOptions:] + 343
9 MyAPP 0x0000000101cba791 -[GIDSignIn signInWithOptions:] + 548
10 MyAPP 0x0000000101cb7163 -[GIDSignIn signIn] + 64
11 MyAPP 0x00000001017b2a2a -[SendGoogleAuthOperation signInIfPossible] + 458
12 MyAPP 0x00000001017b2849 -[SendGoogleAuthOperation requestSignIn] + 169
13 MyAPP 0x00000001017b278d -[SendGoogleAuthOperation start] + 621
14 Foundation 0x0000000104034336 __NSOQSchedule_f + 194
15 libdispatch.dylib 0x00000001096093eb _dispatch_client_callout + 8
16 libdispatch.dylib 0x00000001095ef82c _dispatch_queue_drain + 2215
17 libdispatch.dylib 0x00000001095eed4d _dispatch_queue_invoke + 601
18 libdispatch.dylib 0x00000001095f1996 _dispatch_root_queue_drain + 1420
19 libdispatch.dylib 0x00000001095f1405 _dispatch_worker_thread3 + 111
20 libsystem_pthread.dylib 0x000000010995d4de _pthread_wqthread + 1129
21 libsystem_pthread.dylib 0x000000010995b341 start_wqthread + 13
)
2016-08-30 12:28:10.487 MyAPP [68739:3873962] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType fetcherWithRequest:]: unrecognized selector sent to instance 0x7fcb28475580'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107fe3d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107615deb objc_exception_throw + 48
2 CoreFoundation 0x0000000107fecd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107f32cfa ___forwarding___ + 970
4 CoreFoundation 0x0000000107f328a8 _CF_forwarding_prep_0 + 120
5 MyAPP 0x0000000101e89a9e -[GSDK_GTMOAuth2Authentication beginTokenFetchWithDelegate:didFinishSelector:] + 768
6 MyAPP 0x0000000101cc2307 +[GIDTokenFetchDelegate beginTokenFetchWithAuth:handler:] + 126
7 MyAPP 0x0000000101cbb15a -[GIDSignIn maybeFetchToken:fallback:] + 615
8 MyAPP 0x0000000101cba9dc -[GIDSignIn clearAndAuthenticateWithOptions:] + 343
9 MyAPP 0x0000000101cba791 -[GIDSignIn signInWithOptions:] + 548
10 MyAPP 0x0000000101cb7163 -[GIDSignIn signIn] + 64
11 MyAPP 0x00000001017b2a2a -[SendGoogleAuthOperation signInIfPossible] + 458
12 MyAPP 0x00000001017b2849 -[SendGoogleAuthOperation requestSignIn] + 169
13 MyAPP 0x00000001017b278d -[SendGoogleAuthOperation start] + 621
14 Foundation 0x0000000104034336 __NSOQSchedule_f + 194
15 libdispatch.dylib 0x00000001096093eb _dispatch_client_callout + 8
16 libdispatch.dylib 0x00000001095ef82c _dispatch_queue_drain + 2215
17 libdispatch.dylib 0x00000001095eed4d _dispatch_queue_invoke + 601
18 libdispatch.dylib 0x00000001095f1996 _dispatch_root_queue_drain + 1420
19 libdispatch.dylib 0x00000001095f1405 _dispatch_worker_thread3 + 111
20 libsystem_pthread.dylib 0x000000010995d4de _pthread_wqthread + 1129
21 libsystem_pthread.dylib 0x000000010995b341 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
最佳答案
好的,万一有人遇到这个你必须在主线程上登录
dispatch_async(dispatch_get_main_queue(), ^{
[self.signIn signIn];
});
可能会节省一些时间 :)
关于ios - 撤销 token 后 Google SignIn 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39211977/
为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar
当我在Rails控制台中按向上或向左箭头时,出现此错误:irb(main):001:0>/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in`blockin_rl_dispatch_subseq':invalidbytesequenceinUTF-8(ArgumentError)我使用rvm来管理我的ruby安装。我正在使用=>ruby-2.0.0-p247[x86_64]我使用bundle来管理我的gem,并且我有rb-readline(0.4.2)(人们推荐的最少
似乎无法为此找到有效的答案。我正在阅读Rails教程的第10章第10.1.2节,但似乎无法使邮件程序预览正常工作。我发现处理错误的所有答案都与教程的不同部分相关,我假设我犯的错误正盯着我的脸。我已经完成并将教程中的代码复制/粘贴到相关文件中,但到目前为止,我还看不出我输入的内容与教程中的内容有什么区别。到目前为止,建议是在函数定义中添加或删除参数user,但这并没有解决问题。触发错误的url是http://localhost:3000/rails/mailers/user_mailer/account_activation.http://localhost:3000/rails/mai
这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下
我正在尝试解析一个文本文件,该文件每行包含可变数量的单词和数字,如下所示:foo4.500bar3.001.33foobar如何读取由空格而不是换行符分隔的文件?有什么方法可以设置File("file.txt").foreach方法以使用空格而不是换行符作为分隔符? 最佳答案 接受的答案将slurp文件,这可能是大文本文件的问题。更好的解决方案是IO.foreach.它是惯用的,将按字符流式传输文件:File.foreach(filename,""){|string|putsstring}包含“thisisanexample”结果的
rails中是否有任何规定允许站点的所有AJAXPOST请求在没有authenticity_token的情况下通过?我有一个调用Controller方法的JqueryPOSTajax调用,但我没有在其中放置任何真实性代码,但调用成功。我的ApplicationController确实有'request_forgery_protection'并且我已经改变了config.action_controller.consider_all_requests_local在我的environments/development.rb中为false我还搜索了我的代码以确保我没有重载ajaxSend来发送
1.错误信息:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:requestcanceledwhilewaitingforconnection(Client.Timeoutexceededwhileawaitingheaders)或者:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:TLShandshaketimeout2.报错原因:docker使用的镜像网址默认为国外,下载容易超时,需要修改成国内镜像地址(首先阿里
我试图在我的网站上实现使用Facebook登录功能,但在尝试从Facebook取回访问token时遇到障碍。这是我的代码:ifparams[:error_reason]=="user_denied"thenflash[:error]="TologinwithFacebook,youmustclick'Allow'toletthesiteaccessyourinformation"redirect_to:loginelsifparams[:code]thentoken_uri=URI.parse("https://graph.facebook.com/oauth/access_token
print"Enteryourpassword:"pass=STDIN.noecho(&:gets)puts"Yourpasswordis#{pass}!"输出:Enteryourpassword:input.rb:2:in`':undefinedmethod`noecho'for#>(NoMethodError) 最佳答案 一开始require'io/console'后来的Ruby1.9.3 关于ruby-为什么不能使用类IO的实例方法noecho?,我们在StackOverflow上
我正在尝试创建密码规则来设计可恢复的密码更改。我通过passwords_controller.rb做了一个父类(superclass),但我需要在应用规则之前检查用户角色,但我所拥有的只是reset_password_token。 最佳答案 假设您的模型是用户:User.with_reset_password_token(your_token_here)Source 关于ruby-on-rails-设计通过reset_password_token获取用户,我们在StackOverflow