Unable to build with ionic cordova build ios --prod

I can build fine in Xcode with my cert and provisioning profile. I have tried toggling in Xcode automatic signing with my provisioning profile. In Xcode I can build and archive.

However, I get this error message when running ionic cordova build ios --prod or ionic cordova build ios --release.
Cannot figure out why. Why is it looking for an iOS Development when I am using iOS Distribution

=== BUILD TARGET Xbox Ambassadors OF PROJECT Xbox Ambassadors WITH CONFIGURATION Debug ===

Check dependencies
No signing certificate "iOS Development" found:  No "iOS Development" signing certificate matching team ID "9KBH5RKYEW" with a private key was found.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'


The following build commands failed:
	Check dependencies
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/jordanmc/Documents/src/Responder/Responder/platforms/ios/cordova/build-debug.xcconfig,-workspace,Ambassadors.xcworkspace,-scheme,Ambassadors,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,Ambassadors.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/jordanmc/Documents/src/Responder/Responder/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/jordanmc/Documents/src/Responder/Responder/platforms/ios/build/sharedpch
Jordans-Mac-mini:Responder jordanmc$ cordova build ios --prod

I tried changing build.xcconfig to “iPhone Distribution” but that doesn’t do anything as it still looks for iOS Developer.

// Type of signing identity used for codesigning, resolves to first match of given type.
// "iPhone Developer": Development builds (default, local only; iOS Development certificate) or "iPhone Distribution": Distribution builds (Adhoc/In-House/AppStore; iOS Distribution certificate)
CODE_SIGN_IDENTITY = iPhone Distribution
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution

Thoughts? Seems like I hit this a couple times a day and sometimes it works. Always works in Xcode.


try ionic package build ios --profile=profile_name --release

Were you able to find a solution for that?
I’m hitting the same issue on a project that I was able to build and sign automatically for months. I have no idea how to proceed. I tried everything that I could think was going wrong.