fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.52k stars 890 forks source link

[Bug]: FAiled to build app (Definition of 'FPPSensorsPlusPlugin' must be imported from module) #2535

Closed fullflash closed 15 hours ago

fullflash commented 5 months ago

Platform

IOS 17

Plugin

sensor_plus

Version

4.0.2

Flutter SDK

3.16.4

Steps to reproduce

unable to build app

Code Sample

No response

Logs

Could not build the precompiled application for the device.
Semantic Issue (Xcode): Duplicate interface definition for class 'FPPSensorsPlusPlugin'
sensors_plus/sensors_plus.framework/Headers/FPPSensorsPlusPlugin.h:6:0

Modules Issue (Xcode): Definition of 'FPPSensorsPlusPlugin' must be imported from module 'sensors_plus.Swift' before it is required
Runner/GeneratedPluginRegistrant.m:303:3

Flutter Doctor

Flutter (Channel stable, 3.16.4, on macOS 14.0 23A344 darwin-arm64, locale en-AZ)
    • Flutter version 3.16.4 on channel stable at
      /Users/*****/Documents/SDK_all/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2e9cb0aa71 (6 weeks ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/****/Documents/SDK_all/android
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/****/Documents/SDK_all/android
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.3)
    • 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.6+0-17.0.6b829.9-10027231)

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

[✓] Connected device (4 available)
    • Buzz Test Device (mobile)  • 00008120-001A7062116BC01E            • ios
      • iOS 17.2.1 21C66
    • iPhone 15 Pro Max (mobile) • D79DF45F-5AB2-435F-94CB-3A57E7B90F93 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)            • macos                                •
      darwin-arm64   • macOS 14.0 23A344 darwin-arm64
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 120.0.6099.234

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

• No issues found!

Checklist before submitting a bug

vbuberen commented 5 months ago

It looks like some caching issue. Check you setup. I currently use the latest sensors_plus in 2 projects which build just fine for iOS 17 both locally and on CI.

socialme2 commented 3 months ago

I encountered this issue too. I tried below methods, but they all do not work

  1. upgrade sensors_plus: ^4.0.2 to sensors_plus: ^5.0.0
  2. clean Pods and cache
  3. rebuild ios
  4. upgrade flutter from 3.16 to 3.19.4

env: iOS 13.0

vbuberen commented 3 months ago

I still believe it is the issue on your local side, not the plugin.

Try to run the example app from the plugin to validate it.

socialme2 commented 3 months ago

But why only does this plugin have this issue while others are all fine?

vbuberen commented 3 months ago

But why only does this plugin have this issue while others are all fine?

Did you run the example app as I asked? I don't want to guess as I have no idea about your setup, your project, etc.

vbuberen commented 3 months ago

There are enough answers in Google for similar cases be it Flutter or just iOS projects: https://github.com/oddbit/flutter_facebook_app_events/issues/60 https://stackoverflow.com/a/13132218

It literally took me just 1 minute to find a confirmation for my statement. You could do some search as well, so we don't guess.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days