Skip to main content

Framework not found & Linker command failed with exit code 1

If you encounter error given below

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

Before start please check your iOS deployment target in Xcode.

Step 1 - In Mac check flutter version in your global terminal and in Android studio's terminal.

If not same then set Flutter SDK path for Global environment -

Setting up Flutter SDK Path Globally on macOS
  1. Open Terminal: Launch the Terminal application. You can find it in the Applications folder or search for it using Spotlight (Cmd + Space, then type "Terminal").

  2. Edit Your Shell Profile:

    • For Bash:
      nano ~/.bash_profile
    • For Zsh:
      nano ~/.zshrc
  3. Add Flutter SDK Path: Add the following line at the end of the file:

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

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

  4. Save Changes: Press Ctrl + O to save the file, then press Enter. Press Ctrl + X to exit the editor.

  5. Apply Changes: In the Terminal, run:

    • For Bash:
      source ~/.bash_profile
    • For Zsh:
      source ~/.zshrc
  6. Verify the Flutter version by running the command below -

      flutter doctor --v
Setting up 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 - run this command in terminal

flutter clean; rm -rf Runner.xcworkspace; rm Podfile.lock; flutter pub get; pod install
if still issue is not fixed then move to the next step

If still issue is not fixed then move to the Step 3

Step 3 - Get the new Flutter SDK from the link below and replace it with you SDK.

Flutter SDK Archives