ProKit Flutter - Documentation
ProKit Flutter

Framework not found & Linker command failed with exit code 1

πŸ•’ Estimated Reading: 1 minutes
πŸ“‚ Location: 
Common Errors β†’ iOS errors β†’ Framework not found & Linker command failed with exit code 1

framework not found flutter  
Linker command failed with exit code 1 (use -v to see invocation)

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ“„ Why does this error occur?

This error typically appears when:

  • YourΒ Flutter SDK pathΒ is not set correctly on macOS.
  • There’s aΒ mismatch between Flutter SDK versionsΒ in your global terminal and Android Studio terminal.
  • TheΒ Flutter frameworkΒ is not found during the iOS build process.
  • OrΒ Xcode’s iOS deployment targetΒ is incorrectly set.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

βœ… Step-by-Step Solution

πŸ”Ή Step 1: Check Flutter SDK Version

First, verify your Flutter version:

  • OpenΒ TerminalΒ on your Mac.
  • Run the command:Β flutter –version

Then open Android Studio’s terminal and run the same command. If both versions do not match, you need to set your Flutter SDK globally.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ”§ Set Flutter SDK Path Globally on macOS

1. Open Terminal

Use Spotlight (Cmd + Space) β†’ Type Terminal β†’ Open it.

2. Open Shell Profile for Editing
  • If usingΒ Bash:
    • nano ~/.bash_profile
  • If usingΒ ZshΒ (default on newer macOS):
    • nano ~/.zshrc
3. Add Flutter SDK Path

At the end of the file, add this line:

export PATH="$PATH:/path/to/flutter/bin"

Replace /path/to/flutter with the actual path where Flutter is installed on your system.

4. Save & Exit
  • PressΒ Ctrl + O, thenΒ EnterΒ to save
  • PressΒ Ctrl + XΒ to exit
5. Apply Changes: In the Terminal, run:
  • If usingΒ Bash:
    • source ~/.bash_profile
  • If usingΒ ZshΒ (default on newer macOS):
    • source ~/.zshrc
6. Confirm Setup
  flutter doctor --v

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ› οΈ Set Flutter SDK Path in Android Studio on macOS

Follow these steps to set up the Flutter SDK path in Android Studio on macOS:

  1. Open Android Studio: Launch Android Studio on your Mac.
  2. Open Preferences:
    • Go toΒ β€œAndroid Studio” in the menu bar.
    • Then, select β€œPreferences”.
  3. Access Flutter Settings:
    • In the left-hand pane, navigate toΒ β€œLanguages & Frameworks”.
    • Then, selectΒ β€œFlutter”.
  4. Set Flutter SDK Path:
    • Look for theΒ β€œFlutter SDK path” field.
    • Click on the folder icon next to it.
    • Navigate to the directory where Flutter is installed on your system and select the Flutter SDK folder.
  5. Apply Changes: After selecting the Flutter SDK path, click β€œApply” or β€œOK” to save the changes.
  6. Restart Android Studio: Close and reopen Android Studio for the changes to take effect.

After completing these steps, Android Studio will be configured to use the Flutter SDK from the specified path. This will enable you to create, edit, and run Flutter projects seamlessly within Android Studio on macOS.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ”„ Step 2: Clean & Rebuild Your Project

Run the following commands in your terminal (inside the project root folder):

flutter clean
rm -rf ios/Runner.xcworkspace
rm ios/Podfile.lock
flutter pub get
cd ios
pod install

if still issue is not fixed then move to the next step

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ” Step 3: Update Flutter SDK

If the issue persists:

  1. Download the latest stable Flutter SDK
    πŸ‘‰ DownloadΒ Flutter SDK
  2. Replace your existing SDK with the downloaded one.
  3. Repeat Steps 1 & 2 after replacement.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

βœ… Final Notes:

  • Always verify the correct SDK path in both Android Studio and terminal.