flutter-webrtc: [version:0.6.10+hotfix.1] iOS error: 'WebRTC/WebRTC.h' file not found

When i try to build release on ios (Product -> archive), the build fails with 'WebRTC/WebRTC.h' file not found error. When i downgrade the dependency to 0.6.7, it works without errors, but i need the changes in the latest version for improved iOS audio handling. Screen Shot 2021-10-04 at 4 15 20 AM

version that fails: 0.6.10+hotfix.1 version that works: 0.6.7

Oh and another thing that i noticed while running pod update is that flutter_webrtc.podspec still states s.version = '0.2.2' for almost all the versions, it gets confusing sometimes to check if xcode is using the right version dependency or not 😅

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 13
  • Comments: 37 (5 by maintainers)

Most upvoted comments

I’ve been trying all day to make this work until I found my workaround. My solution works fine with until this day. I’ve added these few lines in my podfile and worked for me so far in the simulator. Not sure if there other problems on the way but at least I was able to run the simulator.

This is how my podfile look at the end of it: Screen Shot 2021-12-25 at 9 26 25 PM

You can fix this issue by doing these following steps:

  1. Delete ios folder
  2. Go to your project directory in terminal and run these commands
  3. flutter create -i objc .
  4. flutter clean && flutter pub get
  5. cd ios
  6. arch -x86_64 pod update
  7. arch -x86_64 pod install
  8. then at the top of your Pod file, paste this line platform :ios, '10.0'
  9. right click on ios folder and open in xcode and then set all deployment target to 10

IMPORTANT: I think webrtc is not working on IOS simulator. I’m not sure. Your can run on real device.

doesnt work on simulators

I’ve been trying all day to make this work until I found my workaround. My solution works fine with until this day. I’ve added these few lines in my podfile and worked for me so far in the simulator. Not sure if there other problems on the way but at least I was able to run the simulator.

This is how my podfile look at the end of it: Screen Shot 2021-12-25 at 9 26 25 PM

Yes, it’s working and if you are too lazy to copy from the picture:

`

post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings[‘IPHONE_DEPLOYMENT_TARGET’]=‘10.0’ config.build_settings[‘EXCLUDED_ARCHS[sdk=iphonesimulators*]’]=‘arm64’ config.build_settings[‘ONLY_ACTIVE_ARCH’]=‘YES’ end end end

`

hey @sm2017 I am trying to use github actions to compile binaries for all platforms. At that time, I will add armv7 to the compilation step. This will solve your issue. If you are in a hurry, you can use the following steps to compile locally

Starting from iOS 14, only apple devices with arm64 architecture have been supported, and the last armv7 device is iPhone 5/5s

I have the same issue when I want to run or build using flutter But I can run with xcode

The only thing that does not work for me with the latest version 0.8.5 is installing on iOS simulator. After setting ONLY_ACTIVE_ARCH as suggested above it works though.

Complete post_install hook for reference:

# ./ios/Podfile
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
  
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|

      # https://github.com/flutter-webrtc/flutter-webrtc/issues/713
      if target.name == "flutter_webrtc" || target.name == "WebRTC-SDK"
        config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
      end
    end
  end
end

hey @sm2017 I am trying to use github actions to compile binaries for all platforms. At that time, I will add armv7 to the compilation step. This will solve your issue. If you are in a hurry, you can use the following steps to compile locally

when is it planned?

Starting from iOS 14, only apple devices with arm64 architecture have been supported, and the last armv7 device is iPhone 5/5s

5s is 64bit 😃

WebRTC-SDK doesn’t have armv7 support, so just remove armv7 from project’s architectures or try to rebuild WebRTC-SDK with armv7 support.

We have the same error on 0.6.10+hotfix.1

For the time being it’s only working in physical devices but not in (IOS) emulators.

I fixed this issue by doing these following steps:

  1. Delete ios folder
  2. Go to your project directory in terminal and run these commands
  3. flutter create -i objc .
  4. flutter clean && flutter pub get
  5. cd ios
  6. arch -x86_64 pod update
  7. arch -x86_64 pod install
  8. then at the top of your Pod file, paste this line platform :ios, '10.0'
  9. right click on ios folder and open in xcode and then set all deployment target to 10

IMPORTANT: I think webrtc is not working on IOS simulator. I’m not sure. Your can run on real device.

It looks nice to me, would you mind to explain what it does, and why it works, It’s better to know the consequence before typing those command to me, thanks.

With the suggested workarounds it works in real device but there is no way to run it in iOS simulators.

Do you have any suggestions for that? There are a lot of packages which depend on WebRTC please fix this issue.

Any news?