101

I have created a Flutter project in Android Studio. It runs fine on Android devices but when I try to run it on Xcode, I get an error as:

Build system information error: /Users/Downloads/flutter_wallpaper-master 2/ios/Flutter/Debug.xcconfig:1: could not find included file 'Generated.xcconfig' in search paths (in target 'Runner')

Can anyone help me with how to solve this issue?

Swift Guy
  • 1,245
  • 2
  • 8
  • 19

7 Answers7

121

Try running flutter build ios and then rerun in Xcode

Austin Chen
  • 1,343
  • 1
  • 5
  • 3
  • 12
    it doesn't work for me, after execution the cmd, I still get the error – Derrick.X Dec 21 '19 at 02:03
  • 1
    after issuing this command, I had to then run some kind of recommended update in xcode to update target ios versions and then it started working. – JTE Feb 05 '21 at 07:39
64

I assume you have already ios/ folder in your Flutter project. If not, you can run flutter build ios.

The root cause of this error most of the times happens after you have cloned a project like from Github.

In order to fix, you need to get the packages and install the pods.

flutter clean && flutter pub get && cd ios/ && pod install 

(In some situation you might need to update your Pod Repo and Pods. You can do that via running pod repo update && pod update)

30

Please follow these steps/run commands

  1. flutter clean (in terminal)
  2. flutter build (in terminal)
  3. In Xcode, then build your project

The error should have gone now :)

Westy92
  • 19,087
  • 4
  • 72
  • 54
Javed Iqbal
  • 413
  • 1
  • 6
  • 10
4

After few hours of search, this solved my issue.

Firstly, run flutter doctor to check if all the dependencies checked. Follow the instructions shown on the terminal if those [] boxes are not completed as [ticked].

flutter channel master
flutter doctor

Then, run this line.

flutter pub get

Lastly, use the following code to rebuild your ios path (assume your ios codes are stored in /ios folder of your project). This step already included the pod install procedure. No need for further pod install execution.

flutter build ios --release --no-codesign
21.kaw
  • 583
  • 2
  • 7
  • 18
1

It seems that Flutter project needs to be build on the XCode Cloud server, before the XCode project is built. This is achieved by adding a post-clone script described here. That is the only thing that worked for me.

app_sciences
  • 783
  • 1
  • 7
  • 14
0

1.) flutter clean 2.) flutter pub get 3.) cd iOS 4.) pub update 5.) flutter run

=> should solve the problem.

If not -> delete the podfile and repeat the process.

Can Kaplan
  • 146
  • 1
  • 7
0

My answer

In my case, the XCode Cloud build was failing but the local builds were succeeding. Turns out the reason was my flutter project was in a subdirectory of the repo. I had to add a cd myflutterproj to ci_post_clone.sh right after the cd $CI_WORKSPACE. Then XCode Cloud builds succeeded.

What happened

ci_post_clone.sh was running the flutter pub get which failed but that failure did not bubble up because no one called set -e before that. So Xcode Cloud was thinking that ci_post_clone.sh succeeded and continued on as though everything was good, only to later fail because the flutter stuff wasn't generated.

I've opened https://github.com/flutter/website/pull/9342

ubershmekel
  • 11,864
  • 10
  • 72
  • 89