Flutter:不推荐使用"UIAlertView":在iOS 9.0中第一次不推荐使用 [英] Flutter: 'UIAlertView' is deprecated: first deprecated in iOS 9.0

查看:96
本文介绍了Flutter:不推荐使用"UIAlertView":在iOS 9.0中第一次不推荐使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下错误:

/Users/flo/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+12/ios/Classes/FLTImagePickerPlugin.m:1
    49:20: warning: 'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated.
    Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead
    [-Wdeprecated-declarations]
        [[[UIAlertView alloc] initWithTitle:@"Error"

我已经尝试做过:

flutter pub缓存修复

.pub-cache/hosted/pub.dartlang.org目录

rm the .pub-cache/hosted/pub.dartlang.org directory

rm podfile.lock和Pods文件夹

rm podfile.lock and Pods folder

但是仍然是同样的问题.有任何想法吗 ?我只发现Swift这样的问题,但与Flutter无关.

But still the same issue. Any ideas ? I only find issues like this for Swift but not related to Flutter.

推荐答案

我允许自己回答我的问题,这可能会使其他有相同问题的人受益,这是一个对我有用的简单解决方案.您无需修复/更新缓存或编辑Podfile并删除Pods文件夹.

I allow myself to answer my question which may benefit others who have the same problem, here is a simple solution that worked for me. You don't have to repair/update the cache or edit the Podfile and remove the Pods folder.

  • 只需在产生错误的Pubspec上注释掉该包(在这种情况下:image_picker)
  • flutter run (由于缺少软件包,您可能会遇到错误,请忽略它们)
  • 取消注释行
  • 再次运行,错误应该消失
  • Just comment out the package on the Pubspec that generates the error (in that case: image_picker)
  • flutter run (you may have errors due to the missing package, ignore them)
  • Uncomment the line
  • Run again and the error should be gone

这篇关于Flutter:不推荐使用"UIAlertView":在iOS 9.0中第一次不推荐使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆