본문 바로가기
expert

오류: iOS에서 flutter를 실행할 때 'Flutter/Flutter.h' 파일을 찾을 수 없습니다.

by RWriter 2023. 1. 28.
반응형

질문 제목:

오류: iOS에서 flutter를 실행할 때 'Flutter/Flutter.h' 파일을 찾을 수 없습니다.

질문 내용:

이유는 모르겠지만 새 Macbook에서 앱을 빌드하거나 실행할 수 없습니다. 다른 Mac이나 Windows 컴퓨터에서 동일한 폴더를 실행하고 완벽하게 실행됩니다. 여기서 flutter clean을 실행하면 문제를 해결하기 위해 pub get을 실행해야 합니다. 정상인가요?새 프로젝트를 만들면 flutter run을 정상적으로 실행할 수 있으니 아마도 거기에 플러그인과 관련이 있지 않을까 하는 생각이 듭니다.이 문제를 어떻게 해결할 수 있는지 아십니까? 감사

Flutter Doctor
[✓] Flutter (Channel master, 1.24.0-8.0.pre.343, on macOS 11.0.1 20B29 darwin-x64, locale es-419)
    • Flutter version 1.24.0-8.0.pre.343 at /Users/leo/tools/flutter
    • Framework revision cf6c33e58a (2 days ago), 2020-11-21 14:04:01 -0800
    • Engine revision 23a8e027db
    • Dart version 2.12.0 (build 2.12.0-62.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/leo/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (2 available)
    • sdk gphone x86 arm (mobile) • emulator-5554                        • android-x86 • Android 11 (API
      30) (emulator)
    • iPhone 12 Pro Max (mobile)  • F768139D-7B87-4D9E-93B8-14C7D63786B0 • ios         •
      com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)

• No issues found!




Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...                                                  
Xcode build done.                                           11.4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    <module-includes>:1:9: note: in file included from <module-includes>:1:
    #import "Headers/vibration-umbrella.h"
            ^
    /Users/leo/Apps/previate_esta/ios/Pods/Target Support Files/vibration/vibration-umbrella.h:13:9: note:
    in file included from /Users/leo/Apps/previate_esta/ios/Pods/Target Support
    Files/vibration/vibration-umbrella.h:13:
    #import "VibrationPlugin.h"
            ^
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/vibration-1.4.0/ios/Classes/VibrationPlugin.h:1:9: error:
    'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    <unknown>:0: error: could not build Objective-C module 'vibration'
    In file included from
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.3/ios/Classes/FLTURLLauncherPlugin.m:7:
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.3/ios/Classes/FLTURLLauncherPlugin.h:5:9
    : fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.10/ios/Classes/FLTSharedPreference
    sPlugin.m:5:
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.10/ios/Classes/FLTSharedPreference
    sPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/share-0.6.5/ios/Classes/FLTSharePlugin.m:5:
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/share-0.6.5/ios/Classes/FLTSharePlugin.h:5:9: fatal
    error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+4/ios/Classes/FLTSensorsPlugin.m:5:
    /Users/leo/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+4/ios/Classes/FLTSensorsPlugin.h:5:9: fatal
    error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.




해결 답변:


더 쉬운 솔루션:

  1. ios/Flutter/Flutter.podspec 제거 :rm ios/Flutter/Flutter.podspec
  2. flutter clean
  3. 앱을 다시 실행하십시오.
반응형

댓글