I am working on a Flutter project on macOS Sequoia 15 with Xcode 16.1, running on VMware. When trying to build the project, I encounter the following error:
Module 'audioplayers_darwin' not found
Steps Taken:
- Ran
flutter clean
to clear the build artifacts. - Executed
flutter pub get
to fetch dependencies. - Ran
flutter pub upgrade
to ensure dependencies are up to date. - Navigated to the
ios
folder and ranpod install
without any issues.
Key Details:
-
GeneratedPluginRegistrant.h contains the following import logic:
<code>#if __has_include(<audioplayers_darwin/AudioplayersDarwinPlugin.h>)#import <audioplayers_darwin/AudioplayersDarwinPlugin.h>#else@import audioplayers_darwin;#endif</code><code>#if __has_include(<audioplayers_darwin/AudioplayersDarwinPlugin.h>) #import <audioplayers_darwin/AudioplayersDarwinPlugin.h> #else @import audioplayers_darwin; #endif </code>#if __has_include(<audioplayers_darwin/AudioplayersDarwinPlugin.h>) #import <audioplayers_darwin/AudioplayersDarwinPlugin.h> #else @import audioplayers_darwin; #endif
-
The
Podfile
specifies:<code>platform :ios, '12.0'use_frameworks!flutter_ios_podfile_setup</code><code>platform :ios, '12.0' use_frameworks! flutter_ios_podfile_setup </code>platform :ios, '12.0' use_frameworks! flutter_ios_podfile_setup
(Full
Podfile
content is included below.) -
The
pubspec.yaml
includes:<code>audioplayers: ^6.1.0vibration: ^2.0.1device_info_plus: ^11.2.0path_provider: ^2.5.3</code><code>audioplayers: ^6.1.0 vibration: ^2.0.1 device_info_plus: ^11.2.0 path_provider: ^2.5.3 </code>audioplayers: ^6.1.0 vibration: ^2.0.1 device_info_plus: ^11.2.0 path_provider: ^2.5.3
Environment:
- macOS: Sequoia 15 (VMware)
- Flutter: 3.5.3
- Xcode: 16.1
- iOS Deployment Target: 12.0 (as specified in
Podfile
)
Question:
What could be causing the Module 'audioplayers_darwin' not found
error, and how can I resolve it? Are there any additional steps or configurations I should check for this setup?
Do I need to explicitly add any Podfile
configurations for audioplayers_darwin
, or could there be an issue with how the plugin is being linked?
Any insights or troubleshooting steps would be appreciated.