Fastlane certificate error - ios

I'm starting to have an issue with fastlane. When I run a custom lane that runs pilot the app starts to compile but eventually terminates with an error. In the fastlane log I have:
Provisioning profile "match AppStore com.mycompany.myapp-test" doesn't include signing certificate "iPhone Developer: Bob Trotter (XXXXXXXXX)".
Code signing is required for product type 'Application' in SDK 'iOS 10.0'.
I have logged into the apple developer website. Gone into the provisioning profile and added myself. I have tried doing a project clean and downloading the certificates in xocode. I have also run fastlane certs. Any idea what I am doing wrong here? Any pointers on this would be great!!

It seems that you are trying to use pilot with a developer certificate.
As pilot is used to submit your app to TestFlight and subsequently to ApStore, it seems consistent that the error message saying match AppStore ... for the provisioning profile and iPhone Developer: ... for the certificate would generate errors.
It looks like you are setting the correct provisioning profile but not the correct certificate to match. You can check that on XCode by going to you project target -> Build settings -> Code Signing Identity (Release) and selecting iPhone Distribution
If you are using cert you might as well create Distribution certificates, which your App Store provisioning should be matching.
Alternatively (and personally my option of choice today) you can use match to create you provisioning profiles for both development and distribution, which will also configure your sigh environment variables to be used by XCode.
Based on your example bundle identifier, you could do this by executing the following command(s)
$ sudo gem install match
$ match appstore -a com.mycompany.myapp-test

Related

Provisioning profile "iOS Team Provisioning Profile: ... doesn't support the Associated Domains capability

When trying to build my ionic / cordova app to my iphone it currently fails with the exception Provisioning profile "iOS Team Provisioning Profile: ... doesn't support the Associated Domains capability. (in target 'MyApp' from project 'MyApp'). When building it for the emulator the app just works fine. It already worked on my iphone before but now i just have no idea why it fails.
Maybe someone could help me figure out a solution.
The problem was that i only had a free personal apple developer account. I found out that apple supports different capabilities for free and paid members. You can find those here: https://developer.apple.com/support/app-capabilities/ So basically the associated domains capability which i had added to my project was not supported for me as a free member.
Note: While this may not be the answer for the question above, it is the solution for the same "error message" if you changed your project configs and didn't update the certificates.
This happened to me after adding associated-domains to Runner.entitlements. I had to update all the certificates used by the CI/CD (Bitrise).
Run the commands below as follow.
fastlane match appstore --readonly false --force
fastlane match adhoc --readonly false --force
fastlane match development --readonly false --force
After that rebuild.

Fastlane match setup, using match appstore and match development

I am trying to setup fastlane match but am having trouble understanding this step:
After running fastlane match init you can run the following to generate new certificates and profiles:
fastlane match appstore
fastlane match development
What exactly is appstore and development? Are they supposed be assumed scheme names? My app has two schemes (both have different bundle identifiers) they are called MyApp and MyApp UAT do I need to run fastlane match MyApp and fastlane match MyApp UAT?
No, they are not schemes, they are cert/prov of some types.
Yes, you need to create the cert of any kind for each BundId.
Each certificate represent a BundleID and each prov. profile is dependent of a certificate so... yes, you need to create each cert, and then each prov. profile, as you will do manually on iTC.
Run fastlane match --help and it clarify your question
adhoc Run match for a adhoc provisioning profile
appstore Run match for a appstore provisioning profile
change_password Re-encrypt all files with a different password
decrypt Decrypts the repository and keeps it on the filesystem
development Run match for a development provisioning profile
enterprise Run match for a enterprise provisioning profile
[...]
You see, development mean which is not distribution, you could create also adhoc, etc.. and appStore mean distribution for not the enterprise bundleID.
Any doubt, please ask me ;)

Attempting to install the Release version on my device gets conflict profiles

I am trying to install the Release version of my app on my device to test it.
When I select the Edit > Scheme and under RUN I choose "Release" for Build Configuration
But I get the error:
My App has conflicting provisioning settings. My App is automatically
signed for development, but a conflicting code signing identity iPhone
Distribution has been manually specified. Set the code signing
identity value to "iPhone Developer" in the build settings editor, or
switch to manual signing in the project editor. Code signing is
required for product type 'Application' in SDK 'iOS 10.2'
I have gone to Code Signing and Ensured that my release is my iOS Distribution
I have deleted all my profile, certs and re-imported. I have cleaned the build. I have removed my account.
When I switch to Manual Signing I get the error:
No signing certificate "iOS Distribution" found
No "iOS Distribution" signing certificate matching team ID "XXXXXXXXXX" with a private key was found.
But it is in my KeyChain.
I'm so frustrated. Has anyone else solved this?
You're supposed to use the iOS developer profile when running builds on your device. You can build in release mode still. However you can't install distribution signed binaries through Xcode.
You can create an ad-hoc profile to test push notification for the release build. It is same as the distribution build.

"ionic run ios" How to add provisioning profiles

I wish to use Ionic to run my app on my iOs device with livereload enabled. According to the docs this should be easy:
ionic run ios --device -l
Of course I have to add provisioning profiles, but how am I supposed to do it?
I have the .mobileprovision and the .p12 of the certificate, but no matter what I do I still get this error when running the command:
No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “<MyBundleID>” were found
How am I supposed to add my provisioning profiles? I'm not able to find any info about this in the framework docs.
Note: I can reploy the project using Xcode, but then I don't get the livereload. Plus I'd prefer doing everything from the CLI.
You need to go into XCode and add those provisioning profiles to your device.
Set those provisioning profiles into the build process and add the profile to the device as well.
Though you may not be using Visual Studio, their explanation on the setup works for all methods of building Ionic apps.
The documentation is here, but to tell you what's going on:
Make sure you have a developer account to make provisioning profiles.
You would sign into Itunes Connect to add your device as a testing device
Create an App ID
Create a provisioning profile associated to that App ID
Download the provisioning file into Xcode
Add the provisioning file to your device via Xcode
Run ionic run ios --device -l
That should do the trick.
Follow the setup guide by Microsoft starting at create your provisioning profile.

Application failed codesign verification warning

I got this warning in XCode today when I start running my app on my iPad.
Application failed codesign verification. The signature was invalid,
contains disallowed entitlements, or it was not signed with an iPhone
Distribution Certificate. (-19011)
It is saying that the app's provisioning profile was not signed with a distribution certificate. But I just submitted my app yesterday and switched back my distribution provisioning profile to development provisioning profile. XCode shouldn't think I am still building for distribution. I can still run my app but I can't see any debugging information now. How can I resolve this problem?
In Build settings -> Validate Built Product
Debug: YES changes to NO
Release: No changes to YES
and the warning goes away.
I think I've had some misunderstanding of "Validate Built Product" section before.
In Xcode, go to Product->Scheme->Edit Scheme and make sure that your current scheme build configuration is set to debug.

Resources