xcodebuild looking for provisioning profile for target?

Hopefully this is just some user error but it seems that xcodebuild can't find a provisioning profile for the target, I think, which I'll call MyApp, MyApp.app is the target I think

I updated my provisioning profiles, deleted all and re-added my profiles, checked on the apple dev portal and made sure all is right. I have looked through the build settings and signing info and have not found anything that works or anything to fix that I know of or have been told about by peers. I've cleaned, restarted, tried fastlane, and now I am just using xcodebuild. Here is my error:

sudo xcodebuild -exportArchive -exportOptionsPlist "/Users/MyName/MyApp-ios/ExportOptions.plist" -archivePath '/Users/MyName/Library/Developer/Xcode/Archives/2019-02-20/MyApp 2019-02-20 15.34.28.xcarchive' -exportPath "/path/MyApp.ipa" -allowProvisioningUpdates 
2019-02-22 09:39:26.044 xcodebuild[15743:239787] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/DEV_2019-02- 22_09-39-26.043.xcdistributionlogs'.
error: exportArchive: "MyApp.app" requires a provisioning profile. Error Domain=IDEProvisioningErrorDomain Code=9 ""MyApp.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="MyApp.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

I added MyApp.app and MyApp to my provisioning profile dict and it did not work, I am just trying to build my Development scheme/config. Neither did taking an exportOptions.plist from a successful archive/build using the GUI.

ExportOptions

<plist version="1.0"> 
<dict>
<key>compileBitcode</key>
<false/>
<key>destination</key>
<string>export</string>
<key>method</key>
<string>enterprise</string>
<key>provisioningProfiles</key>
<dict>
<key>com.mycompany.myappDEV</key>
<string>*********UUID**********</string>
<key>com.mycompany.myappQA</key>
<string>*********UUID**********</string>
<key>com.mycompany.myappPROD</key>
<string>*********UUID**********</string>
</dict> <key>signingCertificate</key>
<string>iPhone Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>XXXXXXXXX</string>
<key>thinning</key>
<string>&lt;none&gt;</string>
</dict>
</plist>

How do I set a provisioning profile for my Target? Or what is wrong here.

Replies

Please moderate this post so people can see it

Have you had any luck correcting this? I'm having the same problem.

I'm having the same issue, although only when running with sudo

Any luck on this issue? I am also facing similar error