我正在使用 google_sign_in Flutter 应用程序中用于登录的插件。使用来自 the example 的代码登录代码就是:
GoogleSignIn _googleSignIn = new GoogleSignIn(
scopes: <String>[
'email',
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive.metadata',
],
);
Future<Null> _handleSignIn() async {
print("_handleSignIn");
try {
await _googleSignIn.signIn();
} catch (error) {
print("We failed");
print(error);
}
}
这适用于 Android。我按下登录按钮,出现一个弹出窗口,我开始登录。
但是,这个简单的示例在 iOS 上崩溃了。当应用调用上面的 _handleSignIn 时,_googleSignIn.signIn() 调用会导致应用崩溃(它会消失)并显示错误消息:
flutter: _handleSignIn
*** First throw call stack:
(
0 CoreFoundation 0x000000010fe581e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010f4ed031 objc_exception_throw + 48
2 CoreFoundation 0x000000010fecd975 +[NSException raise:format:] + 197
3 Runner 0x000000010ce61d8b -[GIDSignIn signInWithOptions:] + 242
4 Runner 0x000000010ce5e777 -[GIDSignIn signIn] + 64
5 Runner 0x000000010ce591b2 -[FLTGoogleSignInPlugin handleMethodCall:result:] + 2114
6 Flutter 0x000000010d1af716 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 118
7 Flutter 0x000000010d1c5370 _ZNK5shel<…>
Lost connection to device.
我没有构建 iOS 应用程序的经验,所以我可能做错了什么。我关注了the instructions并添加了来自 firebase.com 的 GoogleService-Info.plist 并按照指示更新了我的 Info.plist。
有什么想法吗?有什么方法可以获得更好的错误消息,以便我找出可能出现的问题?
最佳答案
刚刚遇到同样的问题。这是因为我添加了 Google 和 Facebook 登录。
调整 Info.plist。搜索 CFBundleURLTypes .你会看到你有两次。那是错的。从 Facebook 复制 <string>fb??????????????</string>部分并将其粘贴到 Google 部分中的同一数组中。然后删除 CFBundleURLTypes来自 Facebook 部分。
如果您只是按照 Google 登录和 Facebook 登录中的说明进行操作,那么您将粘贴 CFBundleURLTypes Google 部分和 Facebook 部分。只有后一个会被捡起。所以谷歌不在里面。因此,当尝试使用 google 登录时,它会引发异常,因为它没有正确设置。因为 google url 方案被 facebook 覆盖了。
帮助我找出问题的相关问题:
关于 flutter google_sign_in 崩溃 : __exceptionPreprocess + 294,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50536306/
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
在rails源中:https://github.com/rails/rails/blob/master/activesupport/lib/active_support/lazy_load_hooks.rb可以看到以下内容@load_hooks=Hash.new{|h,k|h[k]=[]}在IRB中,它只是初始化一个空哈希。和做有什么区别@load_hooks=Hash.new 最佳答案 查看rubydocumentationforHashnew→new_hashclicktotogglesourcenew(obj)→new_has
我看到这个错误:translationmissing:da.datetime.distance_in_words.about_x_hours我的语言环境文件:http://pastie.org/2944890我的看法:我已将其添加到我的application.rb中:config.i18n.load_path+=Dir[Rails.root.join('my','locales','*.{rb,yml}').to_s]config.i18n.default_locale=:da如果我删除I18配置,帮助程序会处理英语。更新:我在config/enviorments/devolpment
为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar
我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server
当我在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项目:$railsnewsite它执行并到达:bundleinstall但是当它似乎尝试安装依赖项时我得到了这个错误Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcheckingforlibkern/OSAtomic.h...yescreatingMakefilemake"DESTDIR="cleanmake"DESTDIR="
我不知道为什么,但是当我设置这个设置时它无法编译设置:static_cache_control,[:public,:max_age=>300]这是我得到的syntaxerror,unexpectedtASSOC,expecting']'(SyntaxError)set:static_cache_control,[:public,:max_age=>300]^我只想将“过期”header设置为css、javaascript和图像文件。谢谢。 最佳答案 我猜您使用的是Ruby1.8.7。Sinatra文档中显示的语法似乎是在Ruby1.
如何将send与+=一起使用?a=20;a.send"+=",10undefinedmethod`+='for20:Fixnuma=20;a+=10=>30 最佳答案 恐怕你不能。+=不是方法,而是语法糖。参见http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html它说Incommonwithmanyotherlanguages,Rubyhasasyntacticshortcut:a=a+2maybewrittenasa+=2.你能做的最好的事情是:
我对如何计算通过{%assignvar=0%}赋值的变量加一完全感到困惑。这应该是最简单的任务。到目前为止,这是我尝试过的:{%assignamount=0%}{%forvariantinproduct.variants%}{%assignamount=amount+1%}{%endfor%}Amount:{{amount}}结果总是0。也许我忽略了一些明显的东西。也许有更好的方法。我想要存档的只是获取运行的迭代次数。 最佳答案 因为{{incrementamount}}将输出您的变量值并且不会影响{%assign%}定义的变量,我