client-sdk-flutter icon indicating copy to clipboard operation
client-sdk-flutter copied to clipboard

Failed to run ios simulator: No such module 'WebRTC'

Open hrxiang opened this issue 3 years ago • 1 comments

Swift Compiler Error (Xcode): No such module 'WebRTC' /Users/xxxxx/Development/flutter/.pub-cache/hosted/pub.flutter-io.cn/livekit_client-1.0.0/ios/Classes/LiveKitPlugin.swift:0:7

Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code

Could not build the application for the simulator. Error launching application on iPhone 12 Pro Max.

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.0.1, on macOS 11.3.1 20E241 darwin-arm, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] VS Code (version 1.67.2) [✓] Proxy Configuration [✓] Connected device (4 available) [✓] HTTP Host Availability

hrxiang avatar Jun 28 '22 09:06 hrxiang

according to the documentation its not expected to run on ios simulator but on real device

zionnite avatar Jul 15 '22 12:07 zionnite

As commented in this docs, you can add this line in your Podspec file. That worked for me:

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

      # Workaround for https://github.com/flutter/flutter/issues/64502
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # <= this line

    end
  end
end

daniloapr avatar Sep 14 '22 23:09 daniloapr

@daniloapr But that for using m1 machine for compilation. The simulator still don't work as per docs. you would need to test on real device.

@davidliu @cloudwebrtc @davidzhao @dsa Any chance in future it will be supported? Useful when one wants to run e2e tests on device farm.

JasCodes avatar Sep 15 '22 13:09 JasCodes

@jascodes thanks, I'll look into m1 simulator next week

cloudwebrtc avatar Sep 16 '22 06:09 cloudwebrtc

Please upgrade to the latest version of Xcode/Flutter SDK, the example can already work correctly in the simulator (M1) image

cloudwebrtc avatar Oct 17 '22 13:10 cloudwebrtc