0

I am trying to build my IOS app (developed using capacitor and ionic frameworks). Just after integrating Google Firebase and adding Resources/GoogleService-Info.plist file I am having followng error while building my app in XCode.

Command CodeSign failed with a nonzero exit code

CodeSign /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app (in target 'App' from project 'App')
    cd /Users/piyush/Downloads/ncsmobileapp/ios/App
    export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    
    Signing Identity:     "-"
    
    /usr/bin/codesign --force --sign - --entitlements /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/App.build/Debug-iphonesimulator/App.build/App.app.xcent --timestamp\=none --generate-entitlement-der /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app

/Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app: code object is not signed at all
In subcomponent: /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Products/Debug-iphonesimulator/App.app/AppIcon60x60@2x.png
Command CodeSign failed with a nonzero exit code

I tried cleaning the build cahce, restarting the xcode. re-building the app through capacitor, but nothig solved this issue yet. Can anyone help in solving this issue?

Update

While archiving the app following error occurs:

CodeSign /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app (in target 'App' from project 'App')
    cd /Users/piyush/Downloads/ncsmobileapp/ios/App
    export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    
    Signing Identity:     "Apple Development: Piyush Aggarwal (ZWHGYV6A62)"
    Provisioning Profile: "iOS Team Provisioning Profile: app.neo.school"
                          (d2353688-03d7-47ff-942f-4f34fd4c6a93)
    
    /usr/bin/codesign --force --sign 5FE6CDFE4B615D56B70C5DAEB7A151005A1122AE --entitlements /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/App.app.xcent --generate-entitlement-der /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app

/Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app: code object is not signed at all
In subcomponent: /Users/piyush/Library/Developer/Xcode/DerivedData/App-cfgpruswvcmgvpcxuzeyccwfgdyx/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app/AppIcon60x60@2x.png
Command CodeSign failed with a nonzero exit code
Piyush aggarwal
  • 750
  • 2
  • 14
  • 25
  • Your Signing Identity says `"-"`, which doesn't seem like a valid signing identity. Have you tried figuring out how signing should be setup? – EmilioPelaez Jan 19 '22 at 18:18
  • @EmilioPelaez Yes, I have created 1 key in In Apple developer accont and registered is in google firebase accoumt. – Piyush aggarwal Jan 20 '22 at 18:08

3 Answers3

1

Please try to delete the derived data and clean the build.

Steps to delete derived data:-

1.Open your project,Go to files -> Workspace Settings

Then you will find a derived data location with an arrow:-

Just click on that arrow,after that you will find a folder named derived data, delete all the files inside derived data folder. Then it will working fine. Check Screenshot Of derived data location here

Saurabh Pathak
  • 879
  • 7
  • 10
1

The issue was due to resources folder. I created that folder to add my GoogleServices-Info.plist file.

I renamed my resources folder and changaed the path to my GoogleServices-Info.pllist file by following code in build phrases of the app in xcode:

PATH_TO_GOOGLE_PLISTS="${PROJECT_DIR}/App/[FOLDER NAME]"

        cp -r "$PATH_TO_GOOGLE_PLISTS/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" ;

enter image description here

Piyush aggarwal
  • 750
  • 2
  • 14
  • 25
  • I fking hate stupid Apple. This problem wasted me a lot of time. After seeing your answer I just renamed the "Resources" folder to a random name and it worked. You know what? That folder was named "Resources" because I was following their official tutorial. – Luo Mar 14 '23 at 22:54
0

I have the same (random) issue when Archiving project where OneSignal (specifically OneSignalNotificationServiceExtension) framework is included. What I have to do to make it work (w00t) is to change KeyChain Trust setting on Apple Worldwide Developer Relations Certification Authority (Expires: Tuesday, 7 February 2023 at 22:48:47 Central European ) certificate back to Use System Defaults and then again back to Always Trust. I have no idea why this works, but it works.

sabiland
  • 2,526
  • 1
  • 25
  • 24