flutter_sound: [BUG]:Cannot run Flutter 2.5 app on simulator with flutter_sound

Flutter Sound Version : flutter_sound 8.14 through 8.3.12 (I’ve tried various versions)

  • FULL

  • Important: Result of the command : flutter pub deps | grep flutter_sound FINE: Pub 2.14.2 | |-- flutter_sound 8.3.12 | | |-- flutter_sound_platform_interface 8.3.12 | | |-- flutter_sound_web 8.3.12 | | | |-- flutter_sound_platform_interface…


Severity

  • Cannot build my App

Platforms you faced the error

  • iOS Simulator Version 12.5.1 (961.1)

Describe the bug When I build a flutter app using flutter 2.5.1 and I include flutter_sound, the app will not run on the simulator using the flutter run command. However, if I use flutter run and direct execution to a physical device it does run.

Furthermore, if I run the app from XCode and target the simulator it will run.

I have been using flutter_sound for about a year on other versions of flutter, however, when I upgraded to flutter 2.5 this started happening. I then rolled back to flutter 2.1.3 and the issue stopped occurring. After upgrading to flutter 2.5 again the issue started occurring again.

I have been through many many cycles of deleting caches, DerivedData, flutter clean, etc. etc. to no avail.

To Reproduce Steps to reproduce the behavior:

  1. Create a new counter app (default flutter app)
  2. Add flutter_sound 8.3.12 to the Pubspec.yaml file
  3. Build the file using flutter run and target the iOS simulator.
  4. Below is a preview of the output, look at the attached log for the full verbose output:

(notice the references to mobile-ffmpeg-audio and building for iOS Simulator):

/Users/keithblack/Library/Developer/Xcode/DerivedData/Runner-gejpisazgavnwcdkopckhpbmbxgn/Build/Intermediates.noin
                            dex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/arm64/Binary/Runner
                        ld: in
/Users/keithblack/GitHub/flutter_application_1/ios/Pods/mobile-ffmpeg-audio/lame.framework/lame(VbrTag.o),
                        building for iOS Simulator, but linking in object file built for iOS, file
                        '/Users/keithblack/GitHub/flutter_application_1/ios/Pods/mobile-ffmpeg-audio/lame.framework/lame'
for architecture
                        arm64
                        clang: error: linker command failed with exit code 1 (use -v to see invocation)
                    
                    
[+4734 ms] Could not build the application for the simulator.
[   +3 ms] Error launching application on iPhone 12 Pro.
[   +5 ms] "flutter run" took 49,727ms.
[   +7 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:669:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:92:3)
           <asynchronous suspension>
           
           
[  +63 ms] ensureAnalyticsSent: 61ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

flutter_sound_example_build_log.txt

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 24

Most upvoted comments

I solved this problem. It doesn’t seem to be flutter_sound problem, configure the following in the IOS project:

  1. Podfile specifies IOS SDK 10.0
  2. in my app/extension targets, to add “arm64” to the Excluded Architectures build setting when building for the simulator (as your preview appears to be trying to do),
  3. and setting “Build Active Architecture Only” to No for all schemes. Might be worth a try.

l had the same issue and when l switch the channel to beta and upgraded, worked fine. So you may need to switch channel to beta