嘿,我看到这个问题之前其他人也遇到过,并且有一些问题和答案。但提到的解决方案在这里都不起作用
Launching lib/main_stage.dart on iPhone 15 Pro in debug mode...
Warning: CocoaPods is installed but broken. Skipping pod install.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
CocoaPods not installed or not in valid state.
Error launching application on iPhone 15 Pro.
扑医生-v
[✓] Flutter (Channel stable, 2.10.5, on macOS 14.4.1 23E224 darwin-arm, locale en-LK)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
✗ 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 15.3)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[!] Android Studio (version 2023.3)
✗ Unable to find bundled Java version.
[✓] VS Code (version 1.89.1)
[✓] Connected device (2 available)
! Error: Browsing on the local area network for Dinesh'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)
! Error: Browsing on the local area network for Saberion’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)
[✓] HTTP Host Availability
我已经尝试过了
还有 我可以在 Android 上运行这个应用程序 可以运行其他Flutter项目 并且不要更改 cocopods 上的任何配置
第一个 cocoapod catchfile 删除并卸载
喜欢这一步
sudo gem uninstall cocoapods
rm -rf ~/.cocoapods
rm -rf ~/Library/Caches/CocoaPods
rm -rf ~/Library/Preferences/org.cocoapods.*
rm -rf ~/Library/Application\ Support/CocoaPods
rm -rf Pods
rm -rf Podfile.lock
rm -rf *.xcworkspace
然后cocoapod重新安装后 像这样的步骤
自制
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
红宝石
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
rbenv install 3.1.0
rbenv global 3.1.0
gem install cocoapods
pod setup