【问题标题】:error with my code #import <Flutter/Flutter.h>我的代码错误 #import <Flutter/Flutter.h>
【发布时间】:2021-08-15 22:06:22
【问题描述】:

我的问题是:我正在使用来自 pub.dev 的 [share package][1],当我尝试构建我的应用程序时,出现以下错误:

    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from /Users//Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.m:5:
    /Users//Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from /Users/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.m:7:
    /Users/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~ ```

【问题讨论】:

    标签: ios swift flutter android-studio dart


    【解决方案1】:

    对于 Mac 用户: 在你的 Flutter 项目中,尝试在终端上运行flutter pub get

    【讨论】:

      【解决方案2】:

      修复错误:找不到“Flutter/Flutter.h”文件 #import 您需要删除或不使用

      firebase_admob

      使用

      native_admob_flutter

      admob_flutter

      当您使用 firebase 时会出现此错误 如果你在 podfile 中使用这样的代码

      post_install do |installer|
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
          end
        end
      end
      

      【讨论】:

        猜你喜欢
        • 2021-09-04
        • 1970-01-01
        • 2022-01-25
        • 2022-01-15
        • 1970-01-01
        • 2021-11-18
        • 2021-07-21
        • 2021-03-26
        • 2021-09-29
        相关资源
        最近更新 更多