Module 'connectivity not found' in iOS build of Flutter application

Viewed 14005

I have been trying to build my flutter app in iOS simulator but getting build error with following screenshot.

Where my Xcode version is 11.0, CocoaPods version 1.9.3, Flutter version 1.22.0

I have also upgraded connectivity package from 0.4.9+2 to 0.4.9+3 which is latest one. Following some steps by googling but no one is working yet. However my android build is fully ok.

Thanks in advance.

enter image description here

10 Answers

I have solved this issue through running this command in terminal at Project folder directory

rm ios/Podfile && flutter build ios

I solved this problem by setting in the podfile

platform :ios, '12.1'

And then later inserting the same version in Xcode as well

Xcode

For me, it turned out that I was opening ios/Runner.xcodeproj instead of ios/Runner.xcworkspace. Opening ios/Runner.xcworkspace from Xcode worked for me!

I have this issue and this sequence of steps have worked for me.

  1. Go to the ios folder #cd ios
  2. Delete the Podfile #rm Podfile
  3. Run flutter clean
  4. Run flutter pub get
  5. Case you need generate files with build_runner #flutter packages pub run build_runner build --delete-conflicting-outputs
  6. Build for app for iOS. #flutter build ios
  7. Generate your project pods. #cd ios && pod install
  8. Build project from XCode

In many cases it comes because of difference between Pod install version in flutter and Xcode. Just check them or simply add 'platform :ios, '11.0'' to your podfile in flutter.

  1. rm ios/Podfile && flutter build ios
  2. Change the platform number on Podfile "platform :ios, '12.1" (in XCode: Pick 12.1v.--> Runner > info IOS Deployment Target: 12.1)
  3. Open the flutter ios folder (right-click on ios folder in vs. code and click "Open in Xcode")
  4. Go to Product > Schemes > New Scheme
  5. Select the name of your Cocoapod, then click OK

build again

Alternatively, go to your flutter appname/ios folder and type in commandline:

   sudo gem install cocoapods
   flutter pub get    <---may or may not be necessary for you
   pod install

This will install the infuriating cocoapods to your project

If you are working with flavoured build, e.g staging, production, development.

Your app will most likely be running on Runner so click on runner and select the correct build build flavour which in this case would be one of the flavours.

it's mean som dependencies missing on project. I solved same problem by this step.

cd /YourProject/iOS
rm Podfile

flutter clean On your IDE

flutter pub get

And cd /YourProject/iOS

pod install

in xode clear build and close xcode and run this in project folder.

flutter clean && fluttter pub get && cd ios && rm ios/Podfile &&  cd .. &&flutter build ios

open xcworkspace instead of xcodeproj. build the project

Related