Flutter IOS Build failed: #include Generated.xcconfig not found.

Flutter IOS Build failed: #include Generated.xcconfig not found. Is one of the rare exception.

Today I encountered with this strange issue while building an app. It wasted my two hours and when I found what was the cause I felt ashamed of my self 😅 because it was very simple to solve.

Problem: Generated.xcconfig

When you try to archieve any build to upload on app store connect via XCode then build fails due to:

#include? “Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig” #include “Generated.xcconfig”

It occurs due to compiler doesn’t finds file called Generated.xcconfig in your ios>Flutter directory of your Flutter project. In my case it was removed due to git conflect.

Solution

Check if there is any file named “Generated.xcconfig” if not then create the file and put following content inside:

// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=SDK_PATH_OF_FLUTTER
FLUTTER_APPLICATION_PATH=FLUTTER_PROJECT_URL
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build

//YOUR APP VERSION NUMBER
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=5

EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false
TREE_SHAKE_ICONS=true
PACKAGE_CONFIG=FLUTTER_PROJECT_URL/.dart_tool/package_config.json

Explanation

This is one of configuration file of Flutter for IOS basically it’s top level binding for the app. It explain the XCode the environment of the app and Flutter.

Replace SDK_PATH_OF_FLUTTER with your Flutter SDK path and FLUTTER_PROJECT_URL with your Flutter project directory path not the ios folder inside the Flutter.

Happy development! Cheers…

You can find complete solution at my Medium profile. Checkout my training sessions in app development here.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *