18

After upgrading flutter to flutter 1.22.4. I am getting the below error while building the Xcode Project.

Runner.app/Info.plist does not exist. The Flutter "Thin Binary" build phase must run after "Copy Bundle Resources".

Already tried the below options:

  • Flutter clean and run.
  • Removed derived data, clean project, and rebuild.
    • rm -Rf ios/Pods
    • rm ios/Podfile
    • rm -Rf ios/.symlinks
    • rm -Rf ios/Flutter/Flutter.podspec
    • rm -Rf ios/Flutter/Flutter.framework
    • flutter run

After trying all the above options still getting the same error.

Flutter doctor:

[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale en-US)
    • Flutter version 1.22.4 at /Users/dhavalkansara/flutter 1.22.4
    • Framework revision 1aafb3a8b9 (6 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhavalkansara/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-6222593)
    • 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.1

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2020.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin installed
    • Dart plugin version 202.8070

[✓] Connected device (1 available)
    • iPhone 12 Pro Max (mobile) • 9D65DC5D-5DE8-485A-886F-FF26C0466391 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)

! Doctor found issues in 1 category.
  • Project files structure:

enter image description here

  • Info.plist location in build setting:

enter image description here

Also raised an issue for the same on Flutter Github.

Dhaval Kansara
  • 3,478
  • 5
  • 22
  • 50

5 Answers5

38

In Xcode Menu, choose "Product" > "Clean Build Folder".

Run the project again, it solved the issue.

Rico Chan
  • 2,226
  • 2
  • 25
  • 32
23

Solution


Go to Runner(target app) > Build Phases > Run Script and update the run script with the one below.

 /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build.

Also, verify that Runner(target app) > Build Phases > Thin Binary contains below scripts as suggested in XCode 11.4 Support by the flutter team.

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
Jake
  • 1,906
  • 9
  • 32
  • 60
Dhaval Kansara
  • 3,478
  • 5
  • 22
  • 50
  • 3
    this helped me when i have created a new flutter project – salman Dec 29 '20 at 15:45
  • 1
    FYI: I tried with Xcode 12.4 & only after clean the project, it successfully build. Note: in Runner(target app) > Build Phases > Thin Binary ->> "only single line that contains 'thin' present" i.e. "line that contains 'embed'" is not required/present. – g212gs Feb 19 '21 at 09:20
9

There are 2 steps to fix the issue after turn on your terminal window:

-You must navigate to your project folder that you already build with Flutter -Then you will run as below :

  1. $ flutter clean

  2. $ flutter pub get

Then you build with the IOS simulator again. The issue will be solved.

Reason: You have a clash between Xcode versions (old-new) in your app folder. You should clean the old one first and then rebuild it with the new one.

An Nguyen
  • 163
  • 2
  • 9
8

I went with @Dhaval Kansara's suggestion and the error was still there. But after a clean build the problem went away.

Dharman
  • 30,962
  • 25
  • 85
  • 135
kakyo
  • 10,460
  • 14
  • 76
  • 140
  • 1
    This just happened to me after creating a new Flutter project. I went to Xcode first to verify that the script was correct (mentioned in other answer). The script was correct in Xcode, so a clean build just worked for me. – gmdev Jan 18 '21 at 00:30
  • I had the same issue. Best solution is to simply *flutter clean* in the project folder – Henry Feb 24 '21 at 09:51
2

flutter clean in the project folder solved it for me

Raymond Ativie
  • 1,747
  • 2
  • 26
  • 50