GUG 记录-Flutter:当Flutter添加新包后IOS下滚动抛出异常

发布 : 2019-12-28 分类 : Bug记录 浏览 :

如题,在开发中添加sprintf: ^4.0.2包只后,在IOS下编译时不停的抛出异常,具体如下:

1
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: Unimplemented handling of missing static target #0      _rootRunUnary (dart:async/zone.dart:1134:38) #1      _CustomZone.runUnary (dart:async/zone.dart:1031:19) #2      _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7) #3      _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:970:26) #4      _rootRunUnary (dart:async/zone.dart:1138:13) #5      _CustomZone.runUnary (dart:async/zone.dart:1031:19) #6      _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:954:26) #7      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19) #8      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5) #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

原因:

当使用Android Studio添加包后,对应的依赖需要手动在IOS环境下安装,否则就会出现这样的问题。

解决办法:

到工程目录下的ios目录中执行 pod install 命令安装依赖。如下命令:

1
2
cd ios
pod instll

我得出的结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Analyzing dependencies
Downloading dependencies
Installing FMDB (2.7.5)
Installing Flutter (1.0.0)
Installing shared_preferences (0.0.1)
Installing shared_preferences_macos (0.0.1)
Installing shared_preferences_web (0.0.1)
Installing sqflite (0.0.1)
Generating Pods project Integrating client project
Pod installation complete! There are 5 dependencies from the Podfile and 6 total pods installed.

[!] Automatically assigning platform `iOS` with version `10.2` on target `Runner` because no platform was s
pecified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/synt
ax/podfile.html#platform`.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom
config set. In order for CocoaPods integration to work at all, please either set the base configurations of
the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Tar
get Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

之后将APP删除重新编译即可。

最后

如果,这篇文章无法解决你的问题,你可以留言或私信给我。如果对你有所帮助,受累点赞、分享、关注。

本文作者 : Lojze
原文链接 : http://blog.flowlore.com/passages/bug-node-of-flutter-gun-dong-yi-chang-pao-chu/
版权声明 : 版权声明: 本博客所有文章除特别声明外, 均采用 CC BY-NC-SA 4.0 许可协议. 转载请注明出自《舍予书》
留下足迹