Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoundStreamPlugin on iOS 15 crashes #36

Closed
stijnie2210 opened this issue Dec 13, 2021 · 2 comments
Closed

SoundStreamPlugin on iOS 15 crashes #36

stijnie2210 opened this issue Dec 13, 2021 · 2 comments

Comments

@stijnie2210
Copy link

Situation

Recording doesn't start when calling when calling recorderStream.start()
when pausing the recorderstream and resuming it, it crashes the application with the following logs appearing:

sound_stream/SwiftSoundStreamPlugin.swift:199: Fatal error: Unexpectedly found nil while unwrapping an Optional value
* thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
    frame #0: 0x0000000186755cf4 libswiftCore.dylib`_swift_runtime_on_report
libswiftCore.dylib`_swift_runtime_on_report:
->  0x186755cf4 <+0>: ret
libswiftCore.dylib`_swift_reportToDebugger:
    0x186755cf8 <+0>: b      0x186755cf4               ; _swift_runtime_on_report
libswiftCore.dylib`_swift_shouldReportFatalErrorsToDebugger:
    0x186755cfc <+0>: adrp   x8, 335268
    0x186755d00 <+4>: ldrb   w0, [x8, #0x874]
@stijnie2210
Copy link
Author

I solved it, the package itself asks for microphone permission, but if you use permission_handler by baseflow it still says permanentlyDenied. You need to specifically add this in your Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      flutter_additional_ios_build_settings(target)

      # You can enable the permissions needed here. For example to enable camera
      # permission, just remove the `#` character in front so it looks like this:
      #
      # ## dart: PermissionGroup.camera
      # 'PERMISSION_CAMERA=1'
      #
      #  Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        ## dart: PermissionGroup.microphone
        'PERMISSION_MICROPHONE=1',
      ]

    end
  end
end

Adding this resolved my issue.

@Zeehshan
Copy link

I am facing same issue, i can see permission granted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants