Submit an OSX App with helper App in its bundle
Asked Answered
M

4

17

I'm really going mad with this problem! I have an app that contains a simple Helper app which manages the login item for the Main app.

When I try to submit the app I get errors related to the provisioning profile and the entitlements. I'm sure that the problem is related with the Helper app because before than I added it the submission worked with no problem.

At the moment the helper app is code signed and is sandboxed as the main app.

The errors are :

  • Invalid provisioning profile. The provisioning profile included in the bundle is invalid

  • Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the one that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile 'com.apple.application-identifier' in 'myapp.app/Contents/Library/LoginItems/helper.app'

  • Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the one that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile 'com.apple.application-identifier' in 'myapp.app/Contents/MacOS/myapp'

Mab answered 27/6, 2012 at 15:45 Comment(6)
Are you using iCloud storage in your app?Impassion
But then you shouldn't need a provisioning profile at all? Perhaps there are entries in the 'iCloud Containers' list of your (main/helper) app's target summary settings?Impassion
I solve this problem by code signing from terminal! I can't really understand.Mab
I am getting the same error message when trying to validate our app. I even tried to validate the archives the were submitted successfully before and also got the same error.Mcquoid
@Mcquoid check my answer! hope it helps youMab
I had the same problem, I had forgotten to set "3rd Party mac Developer Application" in Code Signing Identity in Project Build Settings.Grammer
A
20

For anyone else coming across this problem, you don't have to codesign the helper app a second time, just remove the "embedded.provisionprofile" from the helper app in the xarchive and you can submit no problem.

Aesthete answered 7/12, 2012 at 4:7 Comment(3)
This worked for me. Both main and helper app are code signed. Both main and helper app have distribution provisioning profiles with separate bundle IDs. I was initially able to build and archive, but encountered issues passing validation. After archiving, I selected the archive and revealed in Finder. Then, manually remove embedded.provisionprofile from the HELPER app deep inside the archive. Then, back in Xcode, re-validate and submit the cleaned archive.Earphone
phew! What a life saver ! God's gift , Masha Allah :)Hexagon
I followed these steps & submitted the app successfully but got the an email from Apple minutes later : "... Invalid Signature - This error occurs when you have signed your app's installer incorrectly. There are two certs required for this process: the "3rd Party Mac Developer Application" cert and the "3rd Party Mac Developer Installer" cert. When signing your package, you need to ensure that you are using the Installer cert to sign your package. Ensure that you are specifying this cert when submitting your app via the Xcode Organizer or when running productbuild from the command line...."Hexagon
M
7

The only solution that seems to solve this problem was codesign and sandboxing the helper app from Xcode and then:


Re-Codesign the Helper app from terminal

codesign -f -s "3rd Party mac Developer Application:" -i "com.bundle.YOUR.HELPER" --entitlements path/to/helper/entitlements YEOR-HELPER.app



Remove provisioning profile from Helper app, adding a "Run script" into the "Build Phases"

rm"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Library/LoginItems/YOUR-HELPER.app/Contents/embedded.provisionprofile"

With this solution we've correctly submitted our App.

Mab answered 8/7, 2012 at 20:13 Comment(4)
How about automatic both? rm "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Library/LoginItems/YOURHELPER.app/Contents/${EMBEDDED_PROFILE_NAME}" and codesign -f -s "${CODE_SIGN_IDENTITY}" -i "com.identifier.YOURHELPER" --entitlements "${SOURCE_ROOT}/Path/To/YOURHELPER.entitlements" "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Library/LoginItems/YOURHELPER.app"Snowshoe
Do you have to explicitly codesign the helper app again? My helper app has its own BundleID and I don't have a production provisioning profile for it. Nonetheless I could archive the main app and it passed iTC test (Status changed to "waiting for review"). Maybe it will get rejected during Apple review? :SDorettadorette
Thanks so much, you made my day. I'm was struggling with this god damn sign errors all week now. I'd give you +100 if I could :DAftershock
I was finally able to resolve this problem by deleting the embedded.provisionprofile file from the helper app by adding the following run script: if [ -f "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile" ]; then rm "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile" echo "Removed embedded provisioning profile." else echo "No profile found" fiHexagon
C
1

I had the 3rd error when I accidentally included some 3rd-party .a files in my target. (They're needed for non-App Store distribution but I'd forgotten to exclude them for the App Store build). The error wasn't too helpful in tracking this down!

Catatonia answered 21/11, 2012 at 2:21 Comment(0)
H
0

I was finally able to resolve this problem by deleting the embedded.provisionprofile file from the helper app by adding the following run script:

if [ -f "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile" ];
then
    rm "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile"
    echo "Removed embedded provisioning profile."
else
    echo "No profile found"
fi
Hexagon answered 9/4, 2014 at 4:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.