老师 不是项目代码的原因,新建的项目,如果不添加shared_preferences: ^0.5.1+2插件就运行正常,添加了这个插件就跑不起来了 报错信息:
Launching lib/main.dart on iPhone X in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To install:
brew install cocoapods
pod setup
Running Xcode build...
Xcode build done. 11.3s
Failed to build iOS app
Could not build the application for the simulator.
Error launching application on iPhone X.
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
/Users/mengliu/AndroidStudioProjects/flutter_app/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'shared_preferences/SharedPreferencesPlugin.h' file not found
#import <shared_preferences/SharedPreferencesPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.