nooto
nooto

Reputation: 21

vscode flutter xCode 16 Parse Issue (Xcode): Module 'Foundation' is needed but has not been provided, and implicit use of module files is disabled

Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.24.3 on channel stable at /Users/gaoang/workPlace/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (6 days ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/gaoang/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.14.3

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

[✓] Android Studio (version 2022.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 11.0.15+0-b2043.56-8887301)

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

flutter+xcode15 vscode run is ok! then upgrade to xcode16 vscode run flutter code have this 。

>     > Could not build the precompiled application for the device. Parse
>     > Issue (Xcode): Module 'Foundation' is needed but has not been
>     > provided, and implicit use of module files is disabled

try upgrade vscode to the last versin。can't work how fix this issue,

Upvotes: 2

Views: 551

Answers (1)

gopelkujo
gopelkujo

Reputation: 822

Since there's no accepted answer yet in the previous similiar question i'll break down the option:

Option 1 - Enable Allow Non-modular Includes In Framework Modules

  1. Open your project in Xcode (your iOS folder)
  2. Select runner on your left menu
  3. Then go to Build Settings section
  4. Search (in filter) allow non-modular includes in framework (or you can find manually in Apple Clang - Language - Modules section)
  5. Set the variable to yes

Option 2 - Reinstall Xcode

This answer based on Xcode 15.4.

Upvotes: 0

Related Questions