Profile file required error thrown while exporting archive from xcodebuild command

Im using xcodebuild to archive and export the archive for a flutter application for ipa generation in azure devops.

Used the following code for archive

Code Block
xcodebuild
-workspace Runner.xcworkspace
-scheme Runner
-sdk iphoneos
-configuration Release
archive
-archivePath $PWD/build/Runner.xcarchive
CODE_SIGN_STYLE=Manual


Created a plist for export options

Code Block xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>uploadBitcode</key>
<false/>
<key>compileBitcode</key>
<false/>
<key>uploadSymbols</key>
<false/>
<key>provisioningProfiles</key>
<dict>
<key>com.companyn.appname</key>
<string>ComapnyAdHocProfile</string>
</dict>
<key>signingCertificate</key>
<string>iOS Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>


Used the following code for export archive to ipa
Code Block
xcodebuild
-exportArchive
-archivePath $PWD/build/Runner.xcarchive
-exportOptionsPlist export.plist
-exportPath $PWD/build/Runner.ipa


I get the error of
Code Block
Error Domain=IDEProvisioningErrorDomain Code=9 ""Runner.app" requires a provisioning profile." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="Runner.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}


The same app builds correctly with the above provisioning profile while building in Xcode.

Can anyone suggest where I went wrong?
I'm having the same issue. I have 2 projects on compiles OK and the other throws this error. Both use the same wildcard Provisioning profile which I have used before.

Build command is: -

ns build ios --release --for-device --provision ***** <I've hidden Profile name>

Error is_ -

Error Domain=IDEProvisioningErrorDomain Code=9 ""WFSL.app" requires a provisioning profile." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="WFSL.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}



EXPORT FAILED **



Command xcodebuild failed with exit code 70
Profile file required error thrown while exporting archive from xcodebuild command
 
 
Q