v3rm0n / intercom_flutter

Flutter wrapper for Intercom libraries
94 stars 140 forks source link

Error while compiling for iOS #119

Closed yogikorke closed 3 years ago

yogikorke commented 3 years ago

Error output from Xcode build: ABAddressBookRequestAccessWithCompletion(ABAddressBookCreate(), ^(bool granted, CFErrorRef error) { ABAddressBookRequestAccessWithCompletion(ABAddressBookCreate(), ^(bool granted, CFErrorRef error) { ABAddressBookRequestAccessWithCompletion(ABAddressBookCreate(), ^(bool granted, CFErrorRef error) { ABAddressBookRequestAccessWithCompletion(ABAddressBookCreate(), ^(bool granted, CFErrorRef error) { [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) /Users/yogeshkorke/Work/FlutterProjects/godigi_project/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoBaseImagePreviewVC.swift:11:8: error: compiling for iOS 9.0, but module 'SwiftyGif' has a minimum deployment target of iOS 10.0: /Users/yogeshkorke/Work/FlutterProjects/godigi_project/build/ios/Debug-iphoneos/SwiftyGif/SwiftyGif.framework/Modules/SwiftyGif.swiftmodule/arm64-apple-ios.swiftmodule

Flutter Doctor output :

yogeshkorke@Yogeshs-MacBook-Air godigi_project % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, 1.26.0-17.5.pre, on macOS 11.2.1 20D74 darwin-x64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] VS Code (version 1.53.2) [✓] Connected device (3 available)

• No issues found! yogeshkorke@Yogeshs-MacBook-Air godigi_project %

I tried setting platform :ios, '10.0' in podfile and in Xcode as well like described here https://flutter.dev/docs/deployment/ios#review-xcode-project-settings but still getting same error.

I also tried solutions from this StackOverflow answer :

  1. https://stackoverflow.com/a/64954635/3930098
  2. https://stackoverflow.com/a/65345891/3930098
zacel commented 3 years ago

How did you solve this? @yogikorke

zacel commented 3 years ago

For others the solution that worked for me was this: https://stackoverflow.com/questions/63967156/xcode-12-compiling-for-ios-10-0-but-module-rxswift-has-a-minimum-deployment

It says to replace this: post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end

with this:

`deployment_target = '12.0'

post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target end end project.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target end end end `

in ios/pods/podfile