[Bug]: FAiled to build app (Definition of 'FPPSensorsPlusPlugin' must be imported from module)
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
- [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
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.
I encountered this issue too. I tried below methods, but they all do not work
- upgrade sensors_plus: ^4.0.2 to sensors_plus: ^5.0.0
- clean Pods and cache
- rebuild ios
- upgrade flutter from 3.16 to 3.19.4
env: iOS 13.0
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.
But why only does this plugin have this issue while others are all fine?
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.
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.
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