颤振错误'package:flutter_web_plugins/flutter_web_plugins.dart'



几天前我创建了一个新项目,进展顺利。今晚我在尝试新东西的时候,项目失败了。

当我无法解决它时,我想从头创建它并将其移动到那里,但是在移动时,我意识到我添加的包有一个问题。这些是我的项目中所有昨天工作正常的包。

version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
carousel_slider: ^4.0.0
shared_preferences: ^2.0.6
line_awesome_flutter: ^2.0.0
delayed_display: ^2.0.0
flutter_bounce: ^1.1.0
auto_size_text: ^3.0.0-nullsafety.0
swipe: ^0.0.1
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/onboard/
- assets/images/

当我添加share_preferences: ^2.0.6包中的generated_plugin_registrant。'import '包:flutter_web_plugins/flutter_web_plugins.dart';'闪烁红色

同时,当我说在google fonts包中运行时,它在ios上给出了一个错误。

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
[!] Failed to load 'shared_preferences' podspec: 
[!] Invalid `shared_preferences.podspec` file: undefined method `HomeFrame=' for #<Pod::Specification name="shared_preferences">
Did you mean?  homepage=.
#  from /Users/thekavak/Desktop/clotie/clotie/ios/.symlinks/plugins/shared_preferences/ios/shared_preferences.podspec:11
#  -------------------------------------------
#                         DESC
>    s.HomeFrame         = 'https://github.com/flutter/plugins'
#    s.license          = { :type => 'BSD', :file => '../LICENSE' }
#  -------------------------------------------
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/external_sources/abstract_external_source.rb:175:in `rescue in store_podspec'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/external_sources/abstract_external_source.rb:161:in `store_podspec'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:989:in `fetch_external_source'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:968:in `block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:967:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:967:in `block in fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:966:in `fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-user-defined-build-types-0.0.7/lib/cocoapods-user-defined-build-types/private_api_hooks.rb:94:in `call'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-user-defined-build-types-0.0.7/lib/cocoapods-user-defined-build-types/private_api_hooks.rb:94:in `block in <class:Installer>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone 12 Pro Max.

所有这些都发生在新的空项目中,我只是添加了包,它开始给出错误,而没有向主文件写入任何内容。

我所能想到的是,在一天我有一个页面在一个旧的项目叫HomeFrame。达特,会不会有什么东西坏了?我该如何解决这个问题?如果你能帮助我,我将不胜感激。

如果您使用的是M1 Mac,您可以这样解决问题。移动到/ios,打开终端,执行以下命令:

sudo arch -x86_64 gem install ffi  
arch -x86_64 pod install --repo-update  

最新更新