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

readlink -f added in XCode < 14.3 causes archiving error #125286

Closed
2 tasks done
rafaellop opened this issue Apr 21, 2023 · 17 comments · Fixed by #125639
Closed
2 tasks done

readlink -f added in XCode < 14.3 causes archiving error #125286

rafaellop opened this issue Apr 21, 2023 · 17 comments · Fixed by #125639
Labels
platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@rafaellop
Copy link

Is there an existing issue for this?

Steps to reproduce

Unfortunately the fix with readlink -f (#123890) doesn't work for older Xcode/MacOS reporting error: readlink: illegal option -- f when trying to flutter build ipa. My env is:

[✓] Flutter (Channel stable, 3.7.12, on macOS 12.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)

It started to happen when I did flutter upgrade to the latest (from 3.7.7 or so).

To reproduce:

  1. Test on the platform as above
  2. Call flutter clean
  3. Call flutter build ipa or precede it with flutter pub get (doesn't matter in fact)
  4. After some time you get Encountered error while archiving for device. and a few rows above there's error message:

mkdir -p
/Users/rocket/Library/Developer/Xcode/DerivedData/Runner-bvkptabgpblonedyoijtfiqcpvjk/Build/Intermediates.noindex/A
rchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.app/Frameworks
Symlinked...
readlink: illegal option -- f
usage: readlink [-n] [file ...]
Command PhaseScriptExecution failed with a nonzero exit code

Expected results

No errors when building archives. No -f flag added on XCode version < 14.3

Actual results

Building archive is broken with error message Encountered error while archiving for device. caused by the -f flag.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[...]
mkdir -p
    /Users/rocket/Library/Developer/Xcode/DerivedData/Runner-bvkptabgpblonedyoijtfiqcpvjk/Build/Intermediates.noindex/A
    rchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.app/Frameworks
    Symlinked...
    readlink: illegal option -- f
    usage: readlink [-n] [file ...]
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

    Result bundle written to path:
        /var/folders/vr/480fjlkx2p35rdk07lgmc4z80000gn/T/flutter_tools.PAAjsj/flutter_ios_build_temp_dirsR80Xg/temporary_x
        cresult_bundle


Encountered error while archiving for device.

Flutter Doctor output

Doctor output

I don't have Android and Chrome installed on this machine so not included in the doctor log.

[✓] Flutter (Channel stable, 3.7.12, on macOS 12.0 21A5248p darwin-x64, locale en-PL)
    • Flutter version 3.7.12 on channel stable at /Users/rocket/Desktop/flutter/SDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (3 days ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • CocoaPods version 1.12.1

[✓] VS Code (version 1.76.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] Connected device (2 available)
    • iPhone 12 (mobile) • E8A448FD-2C4D-4A3E-BBFE-0A0D1B38FAB6 • ios        •
      com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64 • macOS 12.0 21A5248p
      darwin-x64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

@rafaellop rafaellop changed the title readlink -f added in XCode < 14.3 readlink -f added in XCode < 14.3 causes archiving error Apr 21, 2023
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Apr 21, 2023
@danagbemava-nc
Copy link
Member

Hi @rafaellop, please provide the full verbose output of flutter build ipa -v. The output may be huge, so kindly put it into a .txt/.log file or upload it to a service like pastebin so that we can trace the logs.

Thank

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 21, 2023
@rafaellop
Copy link
Author

rafaellop commented Apr 21, 2023

Here's the log from the flutter --verbose build ipa (I did it earlier)
https://www.dropbox.com/s/071sivciqffzhgd/log.txt?dl=0

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 21, 2023
@danagbemava-nc
Copy link
Member

Thanks for the logs.

Can you also share your podfile, podfile.lock & pubspec.yaml files?

Thank you

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 21, 2023
@jmagman
Copy link
Member

jmagman commented Apr 21, 2023

This isn't coming from Flutter, which explicitly doesn't add the flag unless you're running >= Xcode 14.3

// If Xcode not installed or less than 14.3 with readlink behavior change, skip this migration.
if (version == null || version < Version(14, 3, 0)) {
logger.printTrace('Detected Xcode version is $version, below 14.3, skipping "readlink -f" workaround.');
return;
}

This is coming from CocoaPods:
https://github.com/CocoaPods/CocoaPods/releases/tag/1.12.1

Essentially CocoaPods 1.12.1 isn't compatible with Xcode 13.x if that doesn't understand the -f flag.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds in triage Presently being triaged by the triage team labels Apr 21, 2023
@jmagman
Copy link
Member

jmagman commented Apr 21, 2023

@rafaellop I strongly suggest filing an issue with CocoaPods with reproduction steps.

The workaround from Flutter would be to figure out which Xcode version understands this flag and bump the minimum required to that.

@jmagman
Copy link
Member

jmagman commented Apr 21, 2023

I archived and flutter build ipa successfully on Xcode 14 and 13.4 on CocoaPods 1.12.1.

Pods-Runner-frameworks.sh contains the -f flag.

    source="$(readlink -f "${source}")"

@rafaellop can you give very specific reproduction steps? I don't see it.

@jmagman jmagman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 21, 2023
@rafaellop
Copy link
Author

@jmagman I also think it's from cocoapods. Regarding the reproduction steps, I've given them in my issue:

To reproduce:

1. Test on the platform as above
2. Call `flutter clean`
3. Call `flutter build ipa` or precede it with `flutter pub get` (doesn't matter in fact)
4. After some time you get `Encountered error while archiving for device`

I can reproduce that each time I try them. To be more sure you can also clean build in Xcode.
However I can successfully build my archive if I remove the -f flag by hand from the .sh script where it's added.

@danagbemava-nc Are the podfile, podfile.lock & pubspec.yaml files still needed after @jmagman discoveries?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 22, 2023
@danagbemava-nc
Copy link
Member

I believe it might help us reproduce the issue. I also tried to repro with a few of the plugins I saw in your logs with Xcode 13.4.1 and cocoapods 1.12.1 on codemagic and I could not reproduce the bug.

@rafaellop
Copy link
Author

OK, attached below.

I'd like to mention one thing specific to my project if that may matter. Some of my project files in the lib directory are symlinked from a directory outside the project main directory. Something like this:

myapp/
     lib/
         shared/
             localization # this is a symlink the folder shown below

shared/
     localization/

In the file system it looks this way:
lrwxr-xr-x 1 rocket staff 28 Feb 26 19:38 localization -> ../../../shared/localization

Now the files you asked:

podfile

# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

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

podfile.lock

PODS:
  - app_tracking_transparency (0.0.1):
    - Flutter
  - connectivity_plus (0.0.1):
    - Flutter
    - ReachabilitySwift
  - device_info_plus (0.0.1):
    - Flutter
  - Flutter (1.0.0)
  - flutter_app_badger (1.3.0):
    - Flutter
  - flutter_email_sender (0.0.1):
    - Flutter
  - flutter_local_notifications (0.0.1):
    - Flutter
  - flutter_native_timezone (0.0.1):
    - Flutter
  - fluttertoast (0.0.2):
    - Flutter
    - Toast
  - FMDB (2.7.5):
    - FMDB/standard (= 2.7.5)
  - FMDB/standard (2.7.5)
  - Google-Mobile-Ads-SDK (9.14.0):
    - GoogleAppMeasurement (< 11.0, >= 7.0)
    - GoogleUserMessagingPlatform (>= 1.1)
  - google_mobile_ads (1.0.0):
    - Flutter
    - Google-Mobile-Ads-SDK (~> 9.13)
  - GoogleAppMeasurement (10.8.0):
    - GoogleAppMeasurement/AdIdSupport (= 10.8.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
    - GoogleUtilities/MethodSwizzler (~> 7.8)
    - GoogleUtilities/Network (~> 7.8)
    - "GoogleUtilities/NSData+zlib (~> 7.8)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - GoogleAppMeasurement/AdIdSupport (10.8.0):
    - GoogleAppMeasurement/WithoutAdIdSupport (= 10.8.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
    - GoogleUtilities/MethodSwizzler (~> 7.8)
    - GoogleUtilities/Network (~> 7.8)
    - "GoogleUtilities/NSData+zlib (~> 7.8)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - GoogleAppMeasurement/WithoutAdIdSupport (10.8.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
    - GoogleUtilities/MethodSwizzler (~> 7.8)
    - GoogleUtilities/Network (~> 7.8)
    - "GoogleUtilities/NSData+zlib (~> 7.8)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - GoogleUserMessagingPlatform (2.0.1)
  - GoogleUtilities/AppDelegateSwizzler (7.11.1):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (7.11.1):
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleUtilities/Logger (7.11.1):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (7.11.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (7.11.1):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (7.11.1)"
  - GoogleUtilities/Reachability (7.11.1):
    - GoogleUtilities/Logger
  - health (1.0.4):
    - Flutter
  - in_app_review (0.2.0):
    - Flutter
  - nanopb (2.30909.0):
    - nanopb/decode (= 2.30909.0)
    - nanopb/encode (= 2.30909.0)
  - nanopb/decode (2.30909.0)
  - nanopb/encode (2.30909.0)
  - notification_permissions (0.4.4):
    - Flutter
  - path_provider_foundation (0.0.1):
    - Flutter
    - FlutterMacOS
  - permission_handler_apple (9.0.4):
    - Flutter
  - PromisesObjC (2.2.0)
  - purchases_flutter (4.11.2):
    - Flutter
    - PurchasesHybridCommon (= 4.14.2)
  - PurchasesHybridCommon (4.14.2):
    - RevenueCat (= 4.17.9)
  - ReachabilitySwift (5.0.0)
  - RevenueCat (4.17.9)
  - share_plus (0.0.1):
    - Flutter
  - sqflite (0.0.2):
    - Flutter
    - FMDB (>= 2.7.5)
  - Toast (4.0.0)
  - url_launcher_ios (0.0.1):
    - Flutter

DEPENDENCIES:
  - app_tracking_transparency (from `.symlinks/plugins/app_tracking_transparency/ios`)
  - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
  - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
  - Flutter (from `Flutter`)
  - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`)
  - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`)
  - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
  - flutter_native_timezone (from `.symlinks/plugins/flutter_native_timezone/ios`)
  - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
  - google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`)
  - health (from `.symlinks/plugins/health/ios`)
  - in_app_review (from `.symlinks/plugins/in_app_review/ios`)
  - notification_permissions (from `.symlinks/plugins/notification_permissions/ios`)
  - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
  - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
  - purchases_flutter (from `.symlinks/plugins/purchases_flutter/ios`)
  - share_plus (from `.symlinks/plugins/share_plus/ios`)
  - sqflite (from `.symlinks/plugins/sqflite/ios`)
  - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

SPEC REPOS:
  trunk:
    - FMDB
    - Google-Mobile-Ads-SDK
    - GoogleAppMeasurement
    - GoogleUserMessagingPlatform
    - GoogleUtilities
    - nanopb
    - PromisesObjC
    - PurchasesHybridCommon
    - ReachabilitySwift
    - RevenueCat
    - Toast

EXTERNAL SOURCES:
  app_tracking_transparency:
    :path: ".symlinks/plugins/app_tracking_transparency/ios"
  connectivity_plus:
    :path: ".symlinks/plugins/connectivity_plus/ios"
  device_info_plus:
    :path: ".symlinks/plugins/device_info_plus/ios"
  Flutter:
    :path: Flutter
  flutter_app_badger:
    :path: ".symlinks/plugins/flutter_app_badger/ios"
  flutter_email_sender:
    :path: ".symlinks/plugins/flutter_email_sender/ios"
  flutter_local_notifications:
    :path: ".symlinks/plugins/flutter_local_notifications/ios"
  flutter_native_timezone:
    :path: ".symlinks/plugins/flutter_native_timezone/ios"
  fluttertoast:
    :path: ".symlinks/plugins/fluttertoast/ios"
  google_mobile_ads:
    :path: ".symlinks/plugins/google_mobile_ads/ios"
  health:
    :path: ".symlinks/plugins/health/ios"
  in_app_review:
    :path: ".symlinks/plugins/in_app_review/ios"
  notification_permissions:
    :path: ".symlinks/plugins/notification_permissions/ios"
  path_provider_foundation:
    :path: ".symlinks/plugins/path_provider_foundation/ios"
  permission_handler_apple:
    :path: ".symlinks/plugins/permission_handler_apple/ios"
  purchases_flutter:
    :path: ".symlinks/plugins/purchases_flutter/ios"
  share_plus:
    :path: ".symlinks/plugins/share_plus/ios"
  sqflite:
    :path: ".symlinks/plugins/sqflite/ios"
  url_launcher_ios:
    :path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
  app_tracking_transparency: 5b1745ef9ade815f7455cb6a0848349589afb7c5
  connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e
  device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
  Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
  flutter_app_badger: b87fc231847b03b92ce1412aa351842e7e97932f
  flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b
  flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
  flutter_native_timezone: 5f05b2de06c9776b4cc70e1839f03de178394d22
  fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
  FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
  Google-Mobile-Ads-SDK: 4fe6304b771f8467d29978cb790ec1e56e646946
  google_mobile_ads: 528ab4673c5b5fd36321b7e90fc585064cdbaf2b
  GoogleAppMeasurement: 0ba93018e916f7badf915c2337d43cc1fa96b3f9
  GoogleUserMessagingPlatform: 5f8b30daf181805317b6b985bb51c1ff3beca054
  GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
  health: 5a380c0f6c4f619535845992993964293962e99e
  in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
  nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
  notification_permissions: 825ea1bf2a52ab585c53fd7b5e8e96876d735d4b
  path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
  permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
  PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
  purchases_flutter: fd864f53a8242162edd4a76f8726f0de52b30dd2
  PurchasesHybridCommon: 05e767205a460e564ec1bf3ee6057c5ac9068be1
  ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
  RevenueCat: 8cc3e93a5e29a5bac443d38a0973a317e841f3f1
  share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
  sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
  Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
  url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4

PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b

COCOAPODS: 1.12.1

pubspec.yaml

name: myapp
description: App description

publish_to: 'none' 

version: 1.0.0+1000000

environment:
  sdk: '>=2.18.2 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  google_fonts: ^4.0.3
  url_launcher: ^6.1.7
  flutter_localizations:
    sdk: flutter
  ionicons: ^0.2.1
  styled_text: ^7.0.0
  get: ^4.6.5
  get_storage: ^2.0.3
  flutter_animate: ^4.1.0
  easy_debounce: ^2.0.2+1
  flutter_email_sender: ^5.2.0
  path_provider: ^2.0.11
  flutter_native_timezone: ^2.0.0
  timezone: ^0.9.0
  intl: ^0.17.0
  sqflite: ^2.2.2
  path: ^1.8.2
  flutter_slidable: ^3.0.0
  fl_chart: ^0.61.0
  share_plus: ^6.3.0
  in_app_review: ^2.0.6
  restart_app: ^1.1.1  
  health: ^6.0.0
  permission_handler: ^10.2.0
  flutter_local_notifications: ^13.0.0
  google_mobile_ads: ^2.3.0
  connectivity_plus: ^3.0.2
  app_tracking_transparency: ^2.0.3
  purchases_flutter: ^4.9.0
  device_info_plus: ^8.0.0
  http: ^0.13.5
  flutter_carousel_widget: ^2.0.2
  smooth_page_indicator: ^1.0.1
  fluttertoast: ^8.2.1
  dart_openai: ^1.9.1
  crypto: ^3.0.2
  lottie: ^2.2.0
  flutter_app_badger: ^1.5.0
  notification_permissions: ^0.6.1

flutter_icons: 
  image_path_android: "assets/images/icon.png"
  image_path_ios: "assets/images/icon.png"
  android: true
  ios: true
  adaptive_icon_foreground: "assets/images/icon_adaptive.png" # only available for Android 8.0 devices and above
  adaptive_icon_background: "#19B3F5"
  min_sdk_android: 21
  remove_alpha_ios: true
  web:
    generate: true
    image_path: "assets/images/icon.png"
    background_color: "#19B3F5"
    theme_color: "#19B3F5"
  windows:
    generate: true
    image_path: "assets/images/icon.png"
    icon_size: 48 # min:48, max:256, default: 48
  macos:
    generate: true
    image_path: "assets/images/icon.png"

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.13.0
  very_good_analysis: ^4.0.0+1
  flutter_oss_licenses: ^2.0.1
  flutter_lints: ^2.0.0
  dart_code_metrics: ^5.1.0

flutter:
  uses-material-design: true
  assets:
    - assets/images/
    - assets/images/shared/
    - assets/localization/
    - assets/localization/products/    

@jmagman
Copy link
Member

jmagman commented Apr 24, 2023

Regarding the reproduction steps, I've given them in my issue:

To reproduce:

1. Test on the platform as above
2. Call `flutter clean`
3. Call `flutter build ipa` or precede it with `flutter pub get` (doesn't matter in fact)
4. After some time you get `Encountered error while archiving for device`

Yeah I saw that, I'm asking for actually specific steps starting with a flutter create and adding the plugins, etc, I'm not sure what "Test on the platform as above" exactly means. I am unable to reproduce the archive issue on Xcode 13.4 or CocoaPods 1.12.1. The -f flag was in the script but it archived successfully.

@jmagman jmagman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 24, 2023
@rafaellop
Copy link
Author

rafaellop commented Apr 24, 2023

Platform "as above" is the information about Flutter, MacOS, XCode, versions. I didn't tested using other versions. It's the only platform/environment I use.

OK, now I get what you mean as "steps". I'll try to go all the way starting from flutter create.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 24, 2023
@rafaellop
Copy link
Author

rafaellop commented Apr 24, 2023

So I did a test on a clean project in the same environment:

  1. flutter create test
  2. Added google_fonts: ^4.0.3 to the pubspec.yaml
  3. Called flutter build ipa
  4. Called open ios/Runner.xcworkspace

Finally checked in the XCode the Project Navigator -> Pods -> Targets Support Files -> Pods Runner -> Pods-Runner-frameworks file and it now contains readlink -f in the row 44. I suppose the -f shouldn't be there.

I also did another test and instead of the google_fonts package I added some random package (url_launcher) to the pubspec.yaml and the effect is exactly the same. After flutter build ipa the -f flag appears. flutter pub get before flutter build ipa has no effect on the flag appearance (the Pods section of the project is not yet created in the XCode).

@yuruxuan
Copy link

I have same question😢.

MacOS big sur 11.7.6 with xcode 13.2.1.

mkdir -p /Users/Apple/Library/Developer/Xcode/DerivedData/Runner-cvmzclsfhrthrpcxtfbbfpvtascf/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.app/Frameworks
Symlinked...
readlink: illegal option -- f
usage: readlink [-n] [file ...]
Command PhaseScriptExecution failed with a nonzero exit code

@yuruxuan

This comment was marked as duplicate.

@jmagman
Copy link
Member

jmagman commented Apr 25, 2023

  1. flutter create test
  2. Added google_fonts: ^4.0.3 to the pubspec.yaml
  3. Called flutter build ipa
  4. Called open ios/Runner.xcworkspace

Finally checked in the XCode the Project Navigator -> Pods -> Targets Support Files -> Pods Runner -> Pods-Runner-frameworks file and it now contains readlink -f in the row 44. I suppose the -f shouldn't be there.

The -f is coming from CocoaPods, not Flutter. @rafaellop did you file an issue with them? I don't see one.

  1. flutter create test
  2. Added google_fonts: ^4.0.3 to the pubspec.yaml
  3. I am on macOS 13.3.1 so I wasn't able to open Xcode 13.4, but I am using its toolchain on the command line to flutter build ipa. I ran flutter build ipa --export-method development (because I don't have the bundle ID set up for the App Store) and it archived correctly.

I'm not sure what else we could do here other than bump the minimum Xcode version to 14.

@jmagman
Copy link
Member

jmagman commented Apr 27, 2023

I am going to bump the Flutter-enforced minimum version to Xcode 14. If you're seeing this:

I strongly suggest filing an issue with CocoaPods with reproduction steps.

Ideally they would add a workaround to this on their side but I don't see a single issue actually reporting it, so they may not even know.

auto-submit bot pushed a commit that referenced this issue Apr 27, 2023
Looks like CocoaPods 1.12.1 is incompatible with < Xcode 14 due to CocoaPods/CocoaPods#11828 (see #123890 for context).

Bump the minimum Xcode version allowed by tooling to 14, released September 2022.

```
[!] Xcode - develop for iOS and macOS (Xcode 13.4)
    � Flutter requires Xcode 14 or higher.
      Download the latest version or update via the Mac App Store.
```

Fixes #125286.
Previous bump at #97746.
@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Apr 28, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants