plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Compile]: Can no longer build iOS package due to ConnectivityPlusPlugin error

Open danadaimy opened this issue 2 years ago • 8 comments

Operating System

MacOS Sonoma v14.6.1

Plugin

ConnectivityPlus

Version

6.0.4

Flutter SDK

3.24.4

Compilation command

Running the build command using Visual Studio Code with the following configuration: { "name": "Flutter-PROD", "type": "dart", "request": "launch", "program": "lib/main.dart", "args": [ ] }, ****

Dart Dependencies

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations: 
    sdk: flutter 
  intl: ^0.19.0
  sqflite: ^2.3.3+1
  path: ^1.9.0
  cupertino_icons: ^1.0.4
  google_maps_flutter: ^2.6.1
  geocoding: ^3.0.0
  provider: ^6.0.2
  uuid: ^4.4.2
  flutter_multi_formatter: ^2.13.0
  firebase_core: ^3.0.0
  firebase_auth: ^5.1.3
  firebase_dynamic_links: ^6.0.4
  firebase_messaging: ^15.0.4
  cloud_firestore: ^5.2.0
  email_validator: ^3.0.0
  device_info_plus: ^11.1.0
  package_info_plus: ^8.0.1
  percent_indicator: ^4.2.3
  firebase_analytics: ^11.2.1
  get: ^4.6.6
  modal_progress_hud_nsn: ^0.5.1
  path_provider: ^2.1.3
  url_launcher: ^6.3.0
  connectivity_plus: ^6.0.4
  upgrader: ^11.3.0
  maps_launcher: ^2.2.1
  shared_preferences: ^2.2.3

Native dependencies

No response

Compilation Error

Launching lib/main.dart on iPhone 15 in debug mode...
Xcode build done.                                           23.4s
Failed to build iOS app
Error (Xcode): 'ConnectivityPlusPlugin' has different definitions in different modules; first difference is definition in module 'connectivity_plus.Swift' found 2 referenced protocols
/Users/dany/Dev/flutter-projects/mobile-publisher/build/ios/Debug-iphonesimulator/connectivity_plus/connectivity_plus.framework/Headers/connectivity_plus-Swift.h:310:11

Modules Issue (Xcode): Definition of 'ConnectivityPlusPlugin' must be imported from module 'connectivity_plus.Swift' before it is required
/Users/dany/Dev/flutter-projects/mobile-publisher/ios/Runner/GeneratedPluginRegistrant.m:108:3

Could not build the application for the simulator.
Error launching application on iPhone 15.

Exited (1).

Flutter Doctor

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.6.1 23G93 darwin-arm64, locale en-CA)
    • Flutter version 3.24.4 on channel stable at /Users/dany/Dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (2 days ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/dany/Library/Android/sdk
    • Platform android-34, build-tools 32.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.94.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.98.0

[✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code copy.app/Contents
    • Flutter extension version 3.98.0

[✓] Connected device (4 available)
    • iPhone 15 (mobile)              • 88496CD5-74DB-4093-BE92-5594E2F83799 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 130.0.6723.70

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Checklist before submitting a bug

  • [X] I searched issues in this repository and couldn't find such bug/problem
  • [X] I Google'd a solution and I couldn't find it
  • [X] I searched on StackOverflow for a solution and I couldn't find it
  • [X] I read the README.md file of the plugin
  • [X] I'm using the latest version of the plugin
  • [X] All dependencies are up to date with flutter pub upgrade
  • [X] I did a flutter clean
  • [X] I tried running the example project

danadaimy avatar Oct 26 '24 17:10 danadaimy

Please note that the plugin was working prior to doing a flutter upgrade and/or an xCode update to verision 16.0. I have always been running off of the flutter stable channel so same channel was being used before and after error appeared.

danadaimy avatar Oct 26 '24 17:10 danadaimy

Another note that commenting out the plugin allows me to successfully build and deploy so this is evidently an issue with the plugin itself.

danadaimy avatar Oct 26 '24 17:10 danadaimy

I was able to build succesfully as follows: I reverted back to connectivityplus 6.0.3, flutter cleaned and rebuilt pods and pub. Then upgraded back to CP 6.0.4, repeated the aforementioned clean-up and package generations.

danadaimy avatar Oct 26 '24 18:10 danadaimy

I put the resolution in the comments upon closing it (Comment and Close action). Is my input not available?

On Mon, Oct 28, 2024, 3:32 a.m. Quan0ptimus @.***> wrote:

How did you solve it?

— Reply to this email directly, view it on GitHub https://github.com/fluttercommunity/plus_plugins/issues/3336#issuecomment-2440752446, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAUU45YBAM7SNQIGX4RLH3Z5XSBTAVCNFSM6AAAAABQU7HWZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQG42TENBUGY . You are receiving this because you modified the open/close state.Message ID: @.***>

danadaimy avatar Oct 28 '24 12:10 danadaimy

@danadaimy what's your solution for fixing this?

nhannguyenandpad avatar Oct 29 '24 02:10 nhannguyenandpad

Had the same issue, I deleted the ios/podfile.lock and ran pod install --repo-update also ran flutter clean and flutter pub get working on version 6.1.0 of connectivity_plus

zvikarp avatar Oct 30 '24 12:10 zvikarp

For me, removing podfile.lock, cleaning workspace (flutter clean), then rolling back my pubspec.yaml to the previous version on GIT, rm -rf Pods/ Podfile.lock to generate new podfile.lock, pub get, pub upgrade (if you want the version), then pod install --repo update, then run.

Mine was accidental update initially which caused my issue.

jackwillswhite avatar Nov 10 '24 08:11 jackwillswhite

flutter clean rm -rf ios/Pods rm -rf ios/Podfile.lock rm -rf ~/Library/Developer/Xcode/DerivedData/* flutter pub get cd ios pod repo update pod install cd .. flutter build ios --release

PraveenJayawardane avatar Sep 25 '25 03:09 PraveenJayawardane