Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error targeting iOS 13.0 when using Flutter 3.3 #2098

Closed
8 of 13 tasks
Jordan-Nelson opened this issue Sep 7, 2022 · 2 comments · Fixed by #2099
Closed
8 of 13 tasks

Error targeting iOS 13.0 when using Flutter 3.3 #2098

Jordan-Nelson opened this issue Sep 7, 2022 · 2 comments · Fixed by #2099
Labels
Build Issues related to building apps using Amplify flutter pending-triage This issue is in the backlog of issues to triage

Comments

@Jordan-Nelson
Copy link
Member

Description

When using a deployment target above 11 (required for DataStore) and Flutter 3.3.x, iOS builds will fail with the exception: error: compiling for iOS 11.0, but module 'amplify_core' has a minimum deployment target of iOS 13.0 (see example of a complete error message below).

Full error:

    import amplify_core
           ^
    Command EmitSwiftModule failed with a nonzero exit code
    error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/nejrd/.pub-cache/hosted/pub.dartlang.org/amplify_flutter_ios-0.6.6/ios/Classes/SwiftAmplify.swift:21:8: error: compiling for iOS 11.0, but module 'amplify_core' has a minimum deployment target of iOS 13.0: /Users/nejrd/Documents/dev/sb/min_dep_target/build/ios/Debug-iphonesimulator/amplify_core/amplify_core.framework/Modules/amplify_core.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import amplify_core
           ^
    Command EmitSwiftModule failed with a nonzero exit code
    error: emit-module command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    Result bundle written to path:
    	/var/folders/3n/3plhqvn96jq6thcpd50d2pgh0000gr/T/flutter_tools.MQMSYm/flutter_ios_build_temp_dir7CAtzA/temporary_xcresult_bundle
Swift Compiler Error (Xcode): Compiling for iOS 11.0, but module 'amplify_core' has a minimum deployment target of iOS 13.0: /Users/nejrd/Documents/dev/sb/min_dep_target/build/ios/Debug-iphonesimulator/amplify_core/amplify_core.framework/Modules/amplify_core.swiftmodule/arm64-apple-ios-simulator.swiftmodule
/Users/nejrd/.pub-cache/hosted/pub.dartlang.org/amplify_flutter_ios-0.6.6/ios/Classes/SwiftAmplify.swift:20:7

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

Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Storage

Steps to Reproduce

  1. 'flutter create <project_name>
  2. Add amplify_flutter 0.6.6 as a dependency
  3. Change the min deployment target in ios/Podfile
    4.Build the app for iOS

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Android Device/Emulator API Level

No response

Environment

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.5.1 21G83 darwin-x64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.71.0)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

Dependencies

Dart SDK 2.18.0
Flutter SDK 3.3.1
min_dep_target 1.0.0+1

dependencies:
- amplify_flutter 0.6.6 [amplify_core amplify_datastore_plugin_interface amplify_flutter_android amplify_flutter_ios aws_common collection flutter meta plugin_platform_interface]
- cupertino_icons 1.0.5
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

transitive dependencies:
- amplify_core 0.6.6 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
- amplify_datastore_plugin_interface 0.6.6 [amplify_core collection flutter meta]
- amplify_flutter_android 0.6.6 [flutter]
- amplify_flutter_ios 0.6.6 [amplify_core flutter]
- async 2.9.0 [collection meta]
- aws_common 0.1.1 [async collection http meta stream_transform uuid]
- characters 1.2.1
- clock 1.1.1
- collection 1.16.0
- crypto 3.0.2 [typed_data]
- http 0.13.5 [async http_parser meta path]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- json_annotation 4.6.0 [meta]
- material_color_utilities 0.1.5
- meta 1.8.0
- path 1.8.2
- plugin_platform_interface 2.1.2 [meta]
- sky_engine 0.0.99
- source_span 1.9.0 [collection path term_glyph]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- term_glyph 1.2.1
- typed_data 1.3.1 [collection]
- uuid 3.0.6 [crypto]
- vector_math 2.1.2

Device

iPhone 13

OS

iOS 15.5

Deployment Method

Amplify CLI

CLI Version

N/A

Additional Context

No response

Amplify Config

N/A

@Jordan-Nelson
Copy link
Member Author

Jordan-Nelson commented Sep 7, 2022

Current Work Arounds

Option 1: Downgrade to flutter 3.0.5.

This issue only surfaces in flutter 3.3.x. Temporarily downgrading to flutter 3.0.5 or lower should resolve this issue.

Option 2: Update your Podfile with a post_install hook

Update the existing post install hook in your Podfile

+ deployment_target = '13.0' # Update to match your min version

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['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
+     end
  end
end

@Jordan-Nelson Jordan-Nelson added Build Issues related to building apps using Amplify flutter pending-triage This issue is in the backlog of issues to triage labels Sep 7, 2022
@dnys1
Copy link
Contributor

dnys1 commented Sep 8, 2022

A fix for this has been released in v0.6.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Issues related to building apps using Amplify flutter pending-triage This issue is in the backlog of issues to triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants