I have flutter module added to the existing iOS app. Not all but few of the packages installed (via pubspec.yaml file) could not be found by the iOS app when compiled, and I'm getting 'Module not found' error in XCode. Those problematic packages are: razorpay_flutter, google_maps_flutter, webview_flutter, and url_launcher until now. Please have a look at screenshot below:
Same is the case with other 3 packages.
Steps to reproduce issue:
razorpay_flutter: ^1.1.3
in the pubspec.yaml file of the
flutter module flutter pub get
. The package will installOne more thing I observed after step 2, that there is some warning regarding issue for add to existing app:
Running "flutter pub get" in lib_smazing...
The plugin `razorpay_flutter` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment.
It may have undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
I guess there is issue with the packages using platform channel/code when added to an existing app, but not sure whether its package-specific issue or a flutter issue with add-to-app.
After few trials and error I found simply running pod install
on iOS project directory fixed the issue.