4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

'soundpool/soundpool-Swift.h' file not found'の解決法

Last updated at Posted at 2019-11-17

Flutterでsoundpoolパッケージを使ってアプリを作っていたら、

soundpool/soundpool-Swift.h' file not found
(中略)
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to ...
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to ...
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to ...
(中略)

というエラーにより、iOSシミュレーターを立ち上げることができなかった。

解決法

Flutterのプロジェクトフォルダの中で、iosフォルダの中にPodfileがあります。
Podfileの記述の中で部分的編集します。


target 'Runner' do
    use_frameworks! # <-この一行を追加
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  # 〜〜〜省略〜〜〜
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '4.2' # <-この一行を追加
    end
  end
end

その上でPodfile.lockを一旦削除して、
再度ビルドすれば、Podfileが更新されて、無事立ち上がります。

追記(2020/12/17)

Flutterのバージョン変更に伴い、Flutter SDK 1.22では、下記のようなエラーが出るのかなと思います。
%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202020-12-16%207.41.05.png

しかし、やはり、

target 'Runner' do
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  use_frameworks! # <-この一行を追加
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config| # <-この一行を追加
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' # <-この一行を追加
    end
  end
end

とPodfileを編集し、Podfile.lockを一度removeコマンドで削除した上で、起動させるとちゃんと動きました。

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?