Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with "Invalid Provisioning Profile" #3447

Closed
fastlanebot opened this issue Dec 23, 2015 · 9 comments
Closed

Error with "Invalid Provisioning Profile" #3447

fastlanebot opened this issue Dec 23, 2015 · 9 comments

Comments

@fastlanebot
Copy link

Original issue by @AndreyNikiforov - Imported from fastlane/match#47

match 0.1.2. Steps:

on dev machine: match nuke, then match development
on circleci: match development, then gym, then pitot

log from CI server for match:
+----------------+----------------------------------------------------+
| Summary for match 0.1.2 |
+----------------+----------------------------------------------------+
| git_url | git+ssh://git@github.com/my2bytes/certificates.git |
| type | development |
| app_identifier | com.My2Bytes.ShoppingApp.Demo |
| username | build@my2bytes.com |
| keychain_name | login.keychain |
| readonly | true |
| verbose | true |
| force | false |
+----------------+----------------------------------------------------+

INFO [2015-12-22 20:56:18.10]: Cloning remote git repo...
INFO [2015-12-22 20:56:18.10]: $ git clone 'git+ssh://git@github.com/my2bytes/certificates.git' '/var/folders/jm/fw86rxds0xn69sk40d18y69m0000gp/T/d20151222-4072-1bzxo1c' --depth 1
INFO [2015-12-22 20:56:18.10]: > Cloning into '/var/folders/jm/fw86rxds0xn69sk40d18y69m0000gp/T/d20151222-4072-1bzxo1c'...
INFO [2015-12-22 20:56:18.49]: > remote: Counting objects: 17, done.
INFO [2015-12-22 20:56:18.49]: > remote: Compressing objects: 100% (17/17), done.
INFO [2015-12-22 20:56:18.53]: > remote: Total 17 (delta 0), reused 16 (delta 0), pack-reused 0
INFO [2015-12-22 20:56:18.53]: > Receiving objects: 100% (17/17), 38.62 KiB | 0 bytes/s, done.
INFO [2015-12-22 20:56:18.61]: > Checking connectivity... done.
INFO [2015-12-22 20:56:18.63]: 🔓 Decrypted 'NZL65R46D5.cer'
INFO [2015-12-22 20:56:18.63]: 🔓 Decrypted 'CMVR7EK86M.cer'
INFO [2015-12-22 20:56:18.64]: 🔓 Decrypted 'NZL65R46D5.p12'
INFO [2015-12-22 20:56:18.65]: 🔓 Decrypted 'CMVR7EK86M.p12'
INFO [2015-12-22 20:56:18.65]: 🔓 Decrypted 'AppStore_com.My2Bytes.ShoppingApp.Demo.mobileprovision'
INFO [2015-12-22 20:56:18.66]: 🔓 Decrypted 'AppStore_com.My2Bytes.ShoppingApp.CLIENT.QA.mobileprovision'
INFO [2015-12-22 20:56:18.67]: 🔓 Decrypted 'Development_com.My2Bytes.ShoppingApp.Demo.mobileprovision'
INFO [2015-12-22 20:56:18.67]: 🔓 Decrypted 'Development_com.My2Bytes.ShoppingApp.CLIENT.QA.mobileprovision'
INFO [2015-12-22 20:56:18.67]: 🔓 Successfully decrypted certificates repo
INFO [2015-12-22 20:56:18.68]: Installing certificate...
INFO [2015-12-22 20:56:18.71]: $ security import /var/folders/jm/fw86rxds0xn69sk40d18y69m0000gp/T/d20151222-4072-1bzxo1c/certs/development/NZL65R46D5.cer -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign -T /usr/bin/security&> /dev/null
INFO [2015-12-22 20:56:18.74]: $ security import /var/folders/jm/fw86rxds0xn69sk40d18y69m0000gp/T/d20151222-4072-1bzxo1c/certs/development/NZL65R46D5.p12 -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign -T /usr/bin/security&> /dev/null
INFO [2015-12-22 20:56:18.78]: Installing provisioning profile...
WARN [2015-12-22 20:56:18.92]: Setting environment variable 'sigh_com.My2Bytes.ShoppingApp.Demo_development' to '5e052cf1-1ec9-48a1-a1f0-f3f445b8d2b8'

+----------------------+------------------------------------------------+
| Installed Provisioning Profile |
+----------------------+------------------------------------------------+
| App Identifier | com.My2Bytes.ShoppingApp.Demo |
| Type | development |
| UUID | 5e052cf1-1ec9-48a1-a1f0-f3f445b8d2b8 |
| Environment Variable | sigh_com.My2Bytes.ShoppingApp.Demo_development |
+----------------------+------------------------------------------------+

error from pilot:
ErrorMessage = ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle com.My2Bytes.ShoppingApp.Demo [Payload/ShoppingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal.

My understanding is that match should take care of signing certificate and provisioning profile. What am I missing and how can it be fixed?

@fastlanebot
Copy link
Author

@AndreyNikiforov commented

Upgraded match to 0.2.2 and got "No Password Supplied" error during "match nuke development". Suspect it is related to fastlane-old/match#42

Downgraded back to 0.1.2.

@fastlanebot
Copy link
Author

@AndreyNikiforov commented

Commented out "pilot" and left "hockey" & "crashlytics". Build was uploaded to hockeyapp & crashlytics successfully and devices are listed (on hockeyApp), so either provisioning profile was generated right OR hockey & crashlytics do not validate certificates/profiles the way testFlight does.

@fastlanebot
Copy link
Author

@MartinRogalla commented

Having the same issue here. Really don't get what's going wrong.
edit: I fixed it, don't have access to the device atm, will update once I have access again.
Update: I was able to fix it by changing all the code signing identities in the project.pbxproj to "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";

Hope it will work for you too.

@fastlanebot
Copy link
Author

@KrauseFx commented

Thanks @MartinRogalla, does this fix the issue for you @AndreyNikiforov? Feel free to re-open the issue

@fastlanebot
Copy link
Author

@AndreyNikiforov commented

@KrauseFx , I think I am missing something important. I assumed that "match" will take care of setting correct code signing identity and provisioning profile from repo.

"match" doc instructs to set provisioning profile in plist to env var, but there is nothing about changing code signing setting in pbxproj. How these settings have to adjusted when I need to "deliver" code to appstore?

@fastlanebot
Copy link
Author

@AndreyNikiforov commented

BTW @MartinRogalla suggested "iPhone Distribution" code signing identity, while screenshot in "match" guide shows "iPhone Development". List of available options in xcode shows Development and Distribution identities in my keychain that I have created with "match".

@fastlanebot
Copy link
Author

@KrauseFx commented

@AndreyNikiforov You have to follow the guide https://github.com/fastlane/match/#setup-xcode-project

@fastlanebot
Copy link
Author

@AndreyNikiforov commented

@KrauseFx , I was following the guide you are giving a link to. It has setup instructions for Provisioning Profile, not Code Signing. Screen shot shows that Code Signing is set to "iPhone Development". I though "match" will set it to the Code Signing identity related to the identities generated by "match" (Development for "match development" and Distribution for "match appstore"). Please let me know what I am missing and better yet update the guide.

@fastlanebot
Copy link
Author

@AndreyNikiforov commented

I figured what I was missing. I tried to do one build and submit artifacts to HockeyApp/Crashlytics as well as TestFlight. That does not work (at least in full), because Crashlytics requires Code Signing for Development as well as Provisioning Profiles with a list of allowed devices, while TestFlight requires AppStore Code Signing (and Provisioning Profile without devices).

I can keep "Don't Sign" in xcode and match/gym takes care of using correct code signing, provisioning profile, and packaging.

@fastlane fastlane locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant