美文网首页
Flutter xcode运行ios问题

Flutter xcode运行ios问题

作者: 星邪Ara | 来源:发表于2021-04-01 13:55 被阅读0次

    一、xcode 报:engine/ios/Flutter.podspec: No such file or directory

    原因是没有这个文件

    解决

    在项目目录终端下执行一下命令就会下载这些文件

    flutter biuld ios
    

    二、xcode 报:'Flutter/Flutter.h' file not found

    我遇到的是ios环境没配好

    解决

    在Android studio终端执行以下命令看看ios配置好了没

    flutter doctor
    

    我出来的是

    [✗] Xcode - develop for iOS and macOS
        ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
          Download at: https://developer.apple.com/xcode/download/
          Or install Xcode via the App Store.
          Once installed, run:
            sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
            sudo xcodebuild -runFirstLaunch
        ✗ CocoaPods not installed.
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To install:
            sudo gem install cocoapods
    

    根据提示执行一下两个命令把问题解决

    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    
    sudo gem install cocoapods
    

    再然后执行

    //1.清除
    flutter clean 
    
    //2.加载插件
    flutter pub get
    
    //3.pod安装
    pod install
    

    三、The following Swift pods cannot yet be integrated as static libraries:

    [!] The following Swift pods cannot yet be integrated as static libraries:
    
    The Swift pod `barcode_scan` depends upon `MTBBarcodeScanner`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
    

    在ios目录下的Podfile添加

    use_modular_headers!
    

    四、CocoaPods did not set the base configuration of your project because your project already has a custom config set.

    [!] 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 `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
    
    

    把下面三个改为node


    {FD9F523A-0C1E-B90F-5A6E-90572DC1F55D}.jpg

    相关文章

      网友评论

          本文标题:Flutter xcode运行ios问题

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