Search code examples
iosflutterdartwebviewflutterwebviewplugin

Cannot run flutter webview on ios simulator


I'm trying to run flutter webview app on iOS simulator but it keeps giving me error. Tried everything, but still same message.

        from /usr/local/bin/pod:23:in `<main>'
Error: To set up CocoaPods for ARM macOS, run:
  arch -x86_64 sudo gem install ffi

Error running pod install
Error launching application on iPhone 12 Pro.
Exited

Any help is welcome. Android works well. This is only for iOS.

Working on Macbook Pro 2020 M1


Solution

  • Run arch -x86_64 pod install --repo-update

    Also make sure you added this in info.plist

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
    </dict>