4

我一直在尝试从 Android Studio 在 iOS 上运行应用程序。我一直在出错

/Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:9: note: in file included from /Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedPluginRegistrant.h"
            ^
    /Users/apple/StudioProjects/example-app/ios/Runner/GeneratedPluginRegistrant.h:8:9: error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    1 error generated.
    <unknown>:0: error: failed to emit precompiled header '/Users/apple/Library/Developer/Xcode/DerivedData/Runner-ggksyvhflvuluxawpqfuznxyoqim/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_LWMBPN794CZS-clang_BZEEHKV9P35.pch' for bridging header '/Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h'
    /Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:9: note: in file included from /Users/apple/StudioProjects/example-app/ios/Runner/Runner-Bridging-Header.h:1:
    #import "GeneratedPluginRegistrant.h"
            ^
    2 errors generated.
    <unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

我已经尝试过 Flutter iOS build failed 一个 pod 文件错误:Podfile is out of date

这是我的颤振医生

[✓] Flutter (Channel stable, 2.0.4, on macOS 11.1 20C69 darwin-x64, locale en-GB)
    • Flutter version 2.0.4 at /Users/apple/development/mobile/flutter
    • Framework revision b1395592de (10 days ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/apple/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • 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 at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] 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)

[✓] VS Code (version 1.53.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (4 available)
    • iPhone (mobile)            • 34570a362a2df73d484d834ef7354c1be8983665 • ios            • iOS 14.4
    • iPhone 12 Pro Max (mobile) • 0EDA0F75-828C-4663-BF48-CC40B7F6BD66     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    • darwin-x64     • macOS 11.1 20C69 darwin-x64
    • Chrome (web)               • chrome                                   • web-javascript • Google Chrome 89.0.4389.114

• No issues found!
Process finished with exit code 0

这里有什么建议吗?

4

1 回答 1

0

我遇到了同样的问题,我通过这样做解决了它:它导致插件依赖于颤动。如何解决此问题:


  1. 第一次关闭 xcode/android studio(flutter)/vs code(flutter) 并重新启动你的电脑。

  2. 打开 vs code/android studio 然后进入 ios 目录并在终端中打开它

  3. 写 :

pod 缓存清理 --all

  1. 写 :

吊舱安装

  1. flutter build ios
  2. flutter run

希望这能解决您的问题谢谢

于 2022-02-01T15:45:50.557 回答