美文网首页
Flutter引入第三方报错(关于插件swift版本的问题)

Flutter引入第三方报错(关于插件swift版本的问题)

作者: oldmonster | 来源:发表于2019-10-09 17:48 被阅读0次

因项目中设计到加密相关,因此在网上找了一个加密的插件

flutter_des: ^1.1.0

然后选择了iphone模拟器运行,报错,错误信息如下:

Launching lib/main.dart on iPhone Xʀ in debug mode...
Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
    -> Fetching podspec for `flutter_des` from `.symlinks/plugins/flutter_des/ios`

    Resolving dependencies of `Podfile`

    Comparing resolved specification to the sandbox manifest
      A Flutter
      A flutter_des

    Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing flutter_des (0.0.1)
      - Running pre install hooks
    [!] Unable to determine Swift version for the following pods:

    - `flutter_des` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/lib/cocoapods/installer/xcode/target_validator.rb:122:in `verify_swift_pods_swift_version'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/lib/cocoapods/installer.rb:578:in `validate_targets'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/lib/cocoapods/installer.rb:158:in `install!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/lib/cocoapods/command/install.rb:51:in `run'
    /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.0.beta.2/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:22:in `load'
    /usr/local/bin/pod:22:in `<main>'

Error output from CocoaPods:
↳

    [!] `<PBXGroup UUID=`97C146E51CF9000F007C117D`>` attempted to initialize an object with an unknown UUID. `CF3B75C9A7D2FA2A4C99F110` for attribute: `children`. This can be the result of a merge and  the unknown UUID is being discarded.

    [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error running pod install
Error launching application on iPhone Xʀ.

先找到对应的ios的工程文件,使用Xcode打开。
在Runner的Build Setting中


企业微信截图_cc654361-bf37-4b3d-9a03-bdc1647eb9dc.png

自行添加,这边的版本的话因为我目前本机是4.2到5.0,因此随便写了个版本。

SWIFT_VERSION   4.2
企业微信截图_d478cc8b-8301-4d93-8ac9-df3cf424e041.png

然后使用终端进行pod install 操作。

当然问题并没有解决,此时报出了import头文件错误的问题,至于如何解决该问题请移步至 Flutter引入第三方插件找不到头文件问题解决

相关文章

网友评论

      本文标题:Flutter引入第三方报错(关于插件swift版本的问题)

      本文链接:https://www.haomeiwen.com/subject/qgmqyctx.html