[Flutter] Fix Lexical or Preprocessor Issue (Xcode): *.h file not found error

2024-08-01 hit count image

Let's see how to fix the flutter Lexical or Preprocessor Issue (Xcode): *.h file not found error that suddenly occurs in Flutter.

Outline

When I was working on a Flutter project, I suddenly encountered the following error.

flutter Lexical or Preprocessor Issue (Xcode): 'FirebaseABTesting/FirebaseABTesting.h' file not found

Even if there was no modification, such an error occurred, and the project could not be built on iOS. In this blog post, I will introduce how to fix the flutter Lexical or Preprocessor Issue (Xcode): *.h file not found error that suddenly occurs in Flutter.

Cause of error

If you encounter the flutter Lexical or Preprocessor Issue (Xcode): *.h file not found error while developing a project in Flutter, it is likely due to an Xcode update.

In most cases, this is a problem caused by the version of CocoaPods being lowered due to an Xcode update. Therefore, even projects that were built normally may experience the flutter Lexical or Preprocessor Issue (Xcode): *.h file not found error due to the version of CocoaPods being lowered due to an Xcode update.

Solve error

In this case, you can solve the problem by updating the version of CocoaPods. Since I installed CocoaPods with Homebrew, I updated the version of CocoaPods using Homebrew as follows.

brew upgrade cocoapods

After updating CocoaPods, move to the problematic project and reinstall Pod by running the following command.

pod install

If necessary, delete the Pods folder and Podfile.lock file, and then reinstall Pod by running the pod install command again.

rm -rf Pods Podfile.lock
pod install

Now, if you rebuild the project, you can see that it is built normally.

Completed

Done! we’ve seen how to fix the flutter Lexical or Preprocessor Issue (Xcode): *.h file not found error that suddenly occurs in Flutter. If you encounter the flutter Lexical or Preprocessor Issue (Xcode): *.h file not found error, try updating the version of CocoaPods to solve it.

Was my blog helpful? Please leave a comment at the bottom. it will be a great help to me!

App promotion

You can use the applications that are created by this blog writer Deku.
Deku created the applications with Flutter.

If you have interested, please try to download them for free.

Posts