When I try to run my Flutter app on an iOS simulator or MacOS, it gives me the following errors below. However, on the Android emulator, it works. I tried to run flutter clean
but it doesn't solve the issue. I'm using IntelliJ IDEA Ultimate for development. How can I solve this?
iOS error:
Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 2.0s
Failed to build iOS app
Error (Xcode): Target debug_unpack_ios failed: Exception: Failed to codesign /Users/julian/Desktop/flutter_projects/chat_app/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter with identity -.
Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.
What you need to do is open Runner.xcodeproj in the ios folder with Xcode, select "Runner" on the top left, then select Signing and Capabilities. There under "Team" you need to add your Apple developer account (It doesn't need to be a paid account).