Today when I build the flutter project in the Mac Book Pro M1, shows error:
Running "flutter pub get" in flutter-netease-music...
Warning: You are using these overridden dependencies:
! flutter_secure_storage 4.2.1 (5.0.2 available)
! platform 3.1.0
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 24.3s
Failed to build iOS app
Error output from Xcode build:
↳
objc[50066]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x1eb7f7678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1039302c8). One of the two will be used. Which one is undefined.
objc[50066]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x1eb7f76c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103930318). One of the two will be used. Which one is undefined.
2022-03-06 16:47:29.678 xcodebuild[50066:2881550] apply_selection_policy_once: avoid use of removable GPUs (via com.apple.dt.xcodebuild:GPUSelectionPolicy->avoidRemovable)
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/1p/dz3r2rz55kd60_t8sgslkvvh0000gn/T/flutter_tools.9wLa3e/flutter_ios_build_temp_diriqK61Z/temporary_xcresult_bundle
/opt/apps/google/flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%47dart-pub%47/system_clock-1.2.0/ios/Classes/include/system_clock.mm:27:23: warning: unused function 'nanoseconds_to_microseconds' [-Wunused-function]
static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs)
^
1 warning generated.
error: the following command failed with exit code 0 but produced no further output
CompileC /Users/xiaoqiangjiang/Library/Developer/Xcode/DerivedData/Runner-dgahknmgihpmutcapyuortbjxwcx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/system_clock.build/Objects-normal/arm64/system_clock-d31bea2685958198934277715b4be883.o /opt/apps/google/flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%47dart-pub%47/system_clock-1.2.0/ios/Classes/include/system_clock.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'system_clock' from project 'Pods')
/Users/xiaoqiangjiang/source/reddwarf/frontend/flutter-netease-music/ios/Pods/SwiftAudioEx/SwiftAudioEx/Classes/AudioSessionController/AudioSessionController.swift:12:49: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
public protocol AudioSessionControllerDelegate: class {
^~~~~
AnyObject
^
Failed to package /Users/xiaoqiangjiang/source/reddwarf/frontend/flutter-netease-music.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/1p/dz3r2rz55kd60_t8sgslkvvh0000gn/T/flutter_tools.9wLa3e/flutter_ios_build_temp_diriqK61Z/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 13.
I have already tried:
sudo xcode-select -r
also tried restart the Android Studio and emulator. also tried:
rm ios/Flutter/Flutter.podspec
flutter clean
I was wonder why did this happen? what should I do to fix it?