Error (Xcode): Unexpected duplicate tasks: Target 'Runner' has copy command from 'path/GoogleService-Info.plist' to 'path/GoogleService-Info.plist

Viewed 238

I am trying to run the flutter project on iOS after doing its setup with firebase properly but I am getting the following duplicate errors related to GoogleService-Info.plist.

here is the full error OutPut

Error output from Xcode build:
↳
    objc[24052]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both /usr/lib/libauthinstall.dylib (0x215b9b620) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106b08598). One of the two will be used. Which one is undefined.
    objc[24052]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x215b9b670) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106b085e8). One of the two will be used. Which one is undefined.
    objc[24052]: Class AppleTypeCRetimerFirmwareRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x215b9b6c0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106b08638). One of the two will be used. Which one is undefined.
    objc[24052]: Class ATCRTRestoreInfoFTABFile is implemented in both /usr/lib/libauthinstall.dylib (0x215b9b710) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106b08688). One of the two will be used. Which one is undefined.
    objc[24052]: Class AppleTypeCRetimerFirmwareCopier is implemented in both /usr/lib/libauthinstall.dylib (0x215b9b760) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106b086d8). One of the two will be used. Which one is undefined.
    objc[24052]: Class ATCRTRestoreInfoFTABSubfile is implemented in both /usr/lib/libauthinstall.dylib (0x215b9b7b0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106b08728). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **

here is xcode output

 Xcode's output:
    ↳
        Writing result bundle at path:
            /var/folders/8r/j5l1hdxj23n759qd_g_kkfk40000gn/T/flutter_tools.ApPpcn/flutter_ios_build_temp_diriZfLbr/temporary_xcresult_bundle
    
        note: Using new build system
        note: Planning
        note: Build preparation complete
        note: Building targets in parallel
        error: Unexpected duplicate tasks:
        1) Target 'Runner' (project 'Runner') has copy command from '/Users/rashidali/Flutter_projects/lubanpoint/ios/Runner/GoogleService-Info.plist' to '/Users/rashidali/Flutter_projects/lubanpoint/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist'
        2) Target 'Runner' (project 'Runner') has copy command from '/Users/rashidali/Flutter_projects/lubanpoint/ios/Runner/GoogleService-Info.plist' to '/Users/rashidali/Flutter_projects/lubanpoint/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist'
    
        Result bundle written to path:
            /var/folders/8r/j5l1hdxj23n759qd_g_kkfk40000gn/T/flutter_tools.ApPpcn/flutter_ios_build_temp_diriZfLbr/temporary_xcresult_bundle
    
    
    Error (Xcode): Unexpected duplicate tasks:
    1) Target 'Runner' (project 'Runner') has copy command from '/Users/rashidali/Flutter_projects/lubanpoint/ios/Runner/GoogleService-Info.plist' to '/Users/rashidali/Flutter_projects/lubanpoint/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist'
    2) Target 'Runner' (project 'Runner') has copy command from '/Users/rashidali/Flutter_projects/lubanpoint/ios/Runner/GoogleService-Info.plist' to '/Users/rashidali/Flutter_projects/lubanpoint/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist'
    
    Could not build the application for the simulator.
    Error launching application on iPhone 13.

kindly help me to resolve this

Error (Xcode): Unexpected duplicate tasks:
1) Target 'Runner' (project 'Runner') has copy command from '/Users/rashidali/Flutter_projects/lubanpoint/ios/Runner/GoogleService-Info.plist' to '/Users/rashidali/Flutter_projects/lubanpoint/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist'
2) Target 'Runner' (project 'Runner') has copy command from '/Users/rashidali/Flutter_projects/lubanpoint/ios/Runner/GoogleService-Info.plist' to '/Users/rashidali/Flutter_projects/lubanpoint/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist'
2 Answers

IMPORTANT: ensure doing all the below steps using xCode. DON'T use any other IDE or other file explorer. It has to be xCode. xCode does something under the hood when you drag and drop a file to your project which is why you would not use any other IDE to do this.

first: remove all GoogleService-Info.plist from your project.

second: drag and drop a fresh copy of GoogleService-Info.plist to the 'project runner' path

third: try running your project again and it should be working fine.

In Xcode, under the Build Phases of your target, ensure that the GoogleService-Info.plist file is included in the Copy Bundle Resources phase, but is not included in the Compile Sources phase. I had it in both and after removing it from Compile Sources the error was resolved.

Related