I've been dealing with this error for a long time, I tried many ways but none of them worked. I've listed the ways I've tried below. Please do not recommend them again. Thanks
The Error: /ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'admob_flutter' not found
@import admob_flutter;
~~~~~~~^~~~~~~~~~~~~
1 error generated.
Ways I've Tried
- cd ios -> pod clean -> pod deintegrate -> pod install -> pod update
- I open XCode with .xcworkspace and build again
- delete Podfile.lock and Pods file after that reinstall pods
- And of course flutter clean -> flutter pub get
CodePudding user response:
I fixed it the following way:
close Xcode
uncomment #platform :ios, '9.0'
cd ./ios/
pod install
flutter clean
open ios/Runner.xcworkspace
CodePudding user response:
When you create a Flutter app, the target iOS version is set to 9.0. Most common plugins would have a minimum version higher than 9.0. If you add a plugin that has higher version, Flutter will complain. However, you can silence this error in two ways - either by setting a higher platform version in ios/Podfile or by using another plugin that has higher version number and depends on the initial plugin (e.g. multiple Firebase plugins). This will usually let you run the app in debug mode without issues, but when you try to build an API, the build will fail saying it cannot find a plugin (and it will be the first one in an alphabetical order, most likely device_info).