Flutter 升级3.22.3相关报错问题

Analyzing dependencies
firebase_analytics: Using Firebase SDK version '10.29.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '10.29.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '10.29.0' defined in 'firebase_core'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb:21: warning: Insecure world writable dir /opt/homebrew/bin in PATH, mode 040777
Run script to upload symbols already exists.
firebase_crashlytics: Using Firebase SDK version '10.29.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '10.29.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "firebase_analytics":
  In Podfile:
    firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)

Specs satisfying the `firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)` dependency were found, but they required a higher minimum deployment target.
flutter update-packages --force-upgrade
Building flutter tool...
Resolving dependencies... (6.8s)
Downloading packages... 
Got dependencies.
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:48:10: Error: Type 'DryRunResult' not found.
  Future<DryRunResult> dryRun({
         ^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:127:10: Error: Type 'DryRunResult' not found.
  Future<DryRunResult> dryRun({
         ^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:754:37: Error: Type 'DryRunResult' not found.
void ensureNativeAssetsBuildSucceed(DryRunResult result) {
                                    ^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:123:26: Error: The getter 'packagesWithNativeAssets' isn't defined for the class 'PackageLayout'.
 - 'PackageLayout' is from 'package:native_assets_builder/src/package_layout/package_layout.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/native_assets_builder-0.8.1/lib/src/package_layout/package_layout.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'packagesWithNativeAssets'.
    return packageLayout.packagesWithNativeAssets;
                         ^^^^^^^^^^^^^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:137:25: Error: The method 'dryRun' isn't defined for the class 'NativeAssetsBuildRunner'.
 - 'NativeAssetsBuildRunner' is from 'package:native_assets_builder/src/build_runner/build_runner.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/native_assets_builder-0.8.1/lib/src/build_runner/build_runner.dart').
Try correcting the name to the name of an existing method, or defining a method named 'dryRun'.
    return _buildRunner.dryRun(
                        ^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:161:30: Error: Required named parameter 'linkingEnabled' must be provided.
    return _buildRunner.build(
                             ^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:563:9: Error: 'DryRunResult' isn't a type.
  final DryRunResult dryRunResult = await buildRunner.dryRun(
        ^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart:754:37: Error: 'DryRunResult' isn't a type.
void ensureNativeAssetsBuildSucceed(DryRunResult result) {
                                    ^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/android/native_assets.dart:53:9: Error: 'DryRunResult' isn't a type.
  final DryRunResult dryRunResult = await buildRunner.dryRun(
        ^^^^^^^^^^^^
../../../fvm/versions/3.22.0/packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart:51:9: Error: 'DryRunResult' isn't a type.
  final DryRunResult dryRunResult = await buildRunner.dryRun(
        ^^^^^^^^^^^^
➜  ios git:(adaptation_3.22.x) ✗ gem cleanup  
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb:21: warning: Insecure world writable dir /opt/homebrew/bin in PATH, mode 040777
Cleaning up installed gems...
Attempting to uninstall cocoapods-1.11.3
Unable to uninstall cocoapods-1.11.3:
        Gem::FilePermissionError: You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Attempting to uninstall xcodeproj-1.22.0
Unable to uninstall xcodeproj-1.22.0:
        Gem::FilePermissionError: You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Attempting to uninstall cocoapods-1.11.3
Unable to uninstall cocoapods-1.11.3:
        Gem::FilePermissionError: You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Attempting to uninstall xcodeproj-1.22.0
Unable to uninstall xcodeproj-1.22.0:
        Gem::FilePermissionError: You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Clean up complete

firebase相关配置如下:

firebase_crashlytics: ^4.0.4
firebase_analytics: ^11.2.1
firebase_core: ^3.3.0
firebase_messaging: ^15.0.4
firebase_auth: ^5.1.3
注意:对应iOS要求最低版本13.0,请修改iOS配置profile文件版本!!!

相关命令如下:

flutter相关包更新
flutter update-packages --force-upgrade
pod更新:
pod install --repo-update

关键命令:

gem清理一下:
gem cleanup

附上FVM的使用

结语:文章写得有点乱,将就一下,时间紧急,希望能帮到你!

你可能感兴趣的:(flutter,flutter,cocoa,macos)