1

I have a flutter project with flutter module template, and I'm trying to integrate it in my existed iOS project. I used cocoapods to as the flow of part A in official docs below

https://flutter.dev/docs/development/add-to-app/ios/project-setup

Pod install was succeeded, but project build was failed with error 'Flutter/Flutter.h file not found'.

Have tried Xcode clean, reboot, but not work, does anyone have similar experience to share?

And for my iOS project, it has self-defined build configuration, debug and release were removed, will this be an issue when I integrate flutter module in?

Thanks a lot

Below is my pod file

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
#use_modular_headers!

use_frameworks!

flutter_module_path = '../flutter_module_api_handler'
load File.join(flutter_module_path, '.ios', 'Flutter', 'podhelper.rb')

def share_pods
  pod xxx
  ...

target 'MyProject' do
  install_all_flutter_pods(flutter_module_path)
  share_pods
end

target 'MyProjectStage' do
  install_all_flutter_pods(flutter_module_path)
  share_pods
end

NoelChiang
  • 13
  • 2

1 Answers1

0

try below ;

First solution;

flutter pub cache repair
cd ios 
pod init 
pod install
flutter run

If doesnt work type below;

cd ios
pod deintegrate
rm Flutter/Flutter.podspec
rm podfile.lock
flutter clean
flutter pub get
flutter run
Muhtar
  • 1,506
  • 1
  • 8
  • 33