-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Cocoapods shows "undefined method `exists?' for File:Class" error #141167
Comments
I checked on another with the same configuration but still with Xcode 15.1 and it doesn't work, so Xcode 15.2 is not the cause for the problem :( |
I was about to file this. This also reproduces for me in a new project when adding Steps to reproduce
dev_dependencies:
flutter_test:
sdk: flutter
+ integration_test:
+ sdk: flutter
Logsexpand to view the logs➜ playground git:(main) ✗ fr -d macos
Downloading darwin-x64/FlutterMacOS.framework tools... 3.4s
Downloading darwin-x64/gen_snapshot tools... 1,587ms
Downloading darwin-x64-profile/FlutterMacOS.framework tools... 2,210ms
Downloading darwin-x64-profile tools... 1,289ms
Downloading darwin-x64-profile/gen_snapshot tools... 1,456ms
Downloading darwin-x64-release/FlutterMacOS.framework tools... 1,706ms
Downloading darwin-x64-release tools... 1,199ms
Downloading darwin-x64-release/gen_snapshot tools... 1,383ms
Launching lib/main.dart on macOS in debug mode...
Running pod install... 526ms
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``)
Fetching external sources
-> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
Comparing resolved specification to the sandbox manifest
A FlutterMacOS
Downloading dependencies
-> Installing FlutterMacOS (1.0.0)
- Running pre install hooks
- Running pre integrate hooks
Generating Pods project
- Creating Pods project
- Installing files into Pods project
- Adding source files
- Adding frameworks
- Adding libraries
- Adding resources
- Adding development pod helper files
- Linking headers
- Installing Pod Targets
- Installing target `FlutterMacOS` macOS 10.14
- Installing Aggregate Targets
- Installing target `Pods-Runner` macOS 10.14
- Generating Info.plist file at `Pods/Target Support Files/Pods-Runner/Pods-Runner-Info.plist`
- Generating module map file at `Pods/Target Support Files/Pods-Runner/Pods-Runner.modulemap`
- Generating umbrella header at `Pods/Target Support Files/Pods-Runner/Pods-Runner-umbrella.h`
- Generating dummy source at `Pods/Target Support Files/Pods-Runner/Pods-Runner-dummy.m`
- Installing target `Pods-RunnerTests` macOS 10.14
- Generating Info.plist file at `Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests-Info.plist`
- Generating module map file at `Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.modulemap`
- Generating umbrella header at `Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests-umbrella.h`
- Generating dummy source at `Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests-dummy.m`
- Generating deterministic UUIDs
- Stabilizing target UUIDs
- Running post install hooks
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `exists?' for File:Class
/Users/tahatesser/Code/flutter/packages/flutter_tools/bin/podhelper.rb:349:in `flutter_get_local_engine_dir'
/Users/tahatesser/Code/flutter/packages/flutter_tools/bin/podhelper.rb:131:in `flutter_additional_macos_build_settings'
/Users/tahatesser/Projects/playground/macos/Podfile:41:in `block (3 levels) in from_ruby'
/Users/tahatesser/Projects/playground/macos/Podfile:40:in `each'
/Users/tahatesser/Projects/playground/macos/Podfile:40:in `block (2 levels) in from_ruby'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-core-1.14.3/lib/cocoapods-core/podfile.rb:196:in `post_install!'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1013:in `run_podfile_post_install_hook'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:149:in `message'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:307:in `generate_pods_project'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:183:in `integrate'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:170:in `install!'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `<main>'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1015:in `rescue in run_podfile_post_install_hook'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1012:in `run_podfile_post_install_hook'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:149:in `message'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:307:in `generate_pods_project'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:183:in `integrate'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:170:in `install!'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `<main>'
Error output from CocoaPods:
↳
Ignoring ffi-1.16.3 because its extensions are not built. Try: gem pristine ffi --version 1.16.3
Error: Error running pod install
➜ playground git:(main) ✗ Flutter doctorexpand to view the flutter doctor -v results➜ playground git:(main) ✗ fd
[✓] Flutter (Channel main, 3.18.0-19.0.pre.104, on macOS 14.2.1 23C71 darwin-arm64, locale en-US)
• Flutter version 3.18.0-19.0.pre.104 on channel main at /Users/tahatesser/Code/flutter
• Upstream repository [email protected]:TahaTesser/flutter.git
• FLUTTER_GIT_URL = [email protected]:TahaTesser/flutter.git
• Framework revision 12720f0e51 (28 hours ago), 2024-01-08 01:53:21 -0500
• Engine revision bbebee1465
• Dart version 3.3.0 (build 3.3.0-279.0.dev)
• DevTools version 2.31.0
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/tahatesser/Code/android-sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_SDK_ROOT = /Users/tahatesser/Code/android-sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.14.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.85.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.199
! Error: Browsing on the local area network for Taha’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
• No issues found!
➜ playground git:(main) ✗ |
That's right. I had Xcode 15.1 yesterday when I first reproduced this issue. Today after upgrading Xcode 15.2 the issue persists. |
Could it be this change? |
macos on master is broken, ios on master works. Both work on the latest beta (3.18.0-0.2.pre). |
The recently landed flutter#140222 accidentally used the deprecated `exists?` instead of the non-deprecated `exist?` (which other code in this file is already, correctly, using). Fixes flutter#141167
FYI, currently, not only the current master is broken but also the latest beta. |
This comment was marked as off-topic.
This comment was marked as off-topic.
working on beta 3.19.0-0.2.pre |
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 |
Steps to reproduce
I run
flutter build macos
on a project with native dependencies (Firebase) so that cocoapods needs to run. It used to work just fine, but now I'm getting the error messageundefined method
exists?' for File:Class. That method is called
File.exists` in Ruby 3.2 … which is used by my version of cocoapods internally, so it seems. It might have started with Xcode 15.2 which I just installed, but I'm not sure.I'm on Sonoma 14.2.1, using Homebrew 4.2.3, cocoapods 1.14.3 (which is dependent on Ruby 3.2.2 although this version isn't in the PATH) installed via
brew install cocoapods
, Xcode 15.2 and Flutter 3.18.0-19.0.pre.123Expected results
It should run.
Actual results
Code sample
.
Screenshots or Video
.
Logs
.
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: