Search code examples
xcodeflutterios16

Flutter iOS16 with iPhone 14 breaks the build with flutter_in


Got the latest xcode with ios 16 and iPhone 14 emulators. The first error was about the IOS minimum version need to be updated to 11 from 10. Then I finally got these errors in the build and a bit stuck.

Launching lib/main.dart on iPhone 14 Pro in debug mode...
lib/main.dart:1
Xcode build done.                                           17.5s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    /* com.apple.ibtool.document.warnings */
/Users/vivian/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Storyboards/WebView.storyboard:global: warning: This file is set to build for a version older than the deployment target. Functionality may be limited. [9]
    error: the following command failed with exit code 1 but produced no further output
    SwiftEmitModule normal arm64 Emitting\ module\ for\ flutter_inappwebview (in target 'flutter_inappwebview' from project 'Pods')
    note: Building targets in dependency order
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: unexpected C compiler invocation with specified outputs: '/Users/me/Downloads/Dev/MyApp/MyApp/myapp-mobile/build/ios/Debug-iphonesimulator/Runner.app/GeneratedPluginRegistrant.m' (for input: '/Users/me/Downloads/Dev/MyApp/MyApp/myapp-mobile/ios/Runner/GeneratedPluginRegistrant.m') (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro.

I do not have any requirements specified in pubspec.yaml for 'flutter_inappwebview' yet I find it in xcode projects and pod.

Is there any way to fix this error and possibly remove unnecessary packages? (Actually I am sure if it is needed).

I have tried the following:

  1. flutter clean
  2. rm Podfile.lock and Pods
  3. rebuilt
  4. pod install
  5. pod update

Any help is appreciated.


Solution

  • The current workaround I followed until the actual bug fix is merged:

    Update version in Podfile platform :ios, '14.0'

    Delete and recreate your pods cd ios && rm -rf Pods/ Podfile.lock && pod install --repo-update

    Another fix until the merge: https://github.com/pichillilorenzo/flutter_inappwebview/pull/1238#issuecomment-1244976136

    The actual issue: https://github.com/pichillilorenzo/flutter_inappwebview/issues/1216