Flutter 开发人员,
当我想在 IOS(Iphone)模拟器上运行我的 Flutter 项目时,我遇到了这个麻烦:
Xcode build done. 12.7s
Failed to build iOS app
Swift Compiler Error (Xcode): Cannot find 'FlutterLocalNotificationsPlugin' in scope
/Users/mojamal/Desktop/nesp_application/ios/Runner/AppDelegate.swift:14:42
Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.
我做了什么来修复错误:
1-我确实回到了之前的提交,看看我过去是否犯了错误。 (仍然存在该错误)
2- flutter pub update -> flutter pub get -> flutter clean -> flutter build ios -> cd ios -> pod install 是否成功(这一系列命令也不起作用)
但我也得到的是:
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning
Profile for your project by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- Make sure a 'Development Team' is selected under Signing & Capabilities > Team.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
5- Trust your newly created Development Certificate on your iOS device
via Settings > General > Device Management > [your new certificate] > Trust
For more information, please visit:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/
AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
No development certificates available to code sign app for device deployment
但我认为这与我面临的问题无关。
您是否导入了
FlutterLocalNotificationsPlugin
中包含 AppDelegate.swift
的软件包?