No matching provisioning profiles found - NativeScript iOS deploy - ios

I want to publish an update of my NativeScript app into AppStore. Until yesterday the following steps worked:
move into app directory (from Terminal)
execute tns publish ios
enter valid e-mail & password combination
Now I need to do another update, but I keep getting the following error:
=== BUILD TARGET HandyApp OF PROJECT HandyApp WITH CONFIGURATION Release ===
Check dependencies
Code Sign error: No matching provisioning profiles found: No provisioning profiles matching an applicable signing identity were found.
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Command xcodebuild failed with exit code 65
# publish ios
I am working under Xcode 7.3. I checked my iPhone Developer certificate in Xcode and in my keychain, it is active and not expired. The Provisioning Profile is shown in Xcode. I ensured to use the certificate that is saved in apple.developer.com (by downloading it and replacing the old one in that directory).
I got:
my .mobileprovision
my .cer
my .p12
everything in the same directory.
Still there seems something not to be matching. I just can't figure out what might be running wrong. Does anyone know what else I could try to get it working?

Related

Codemagic: Error when building for iOS "No profiles for 'com.example.example' were found: Xcode could't find any iOS App Development

I try to build for iOS my app with Codemagic. I followed the steps for signing iOS apps in the Codemagic docs.
No profiles for 'com.example.example' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.example.example'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
Full error message:
Archiving fun.gatch.chat.example...
Automatically signing iOS for device deployment using specified development team in Xcode project: JB7VLPB7F6
Running pod install... 85.5s
Running Xcode build...
Xcode archive done. 9.5s
Failed to build iOS app
Error output from Xcode build:
↳
** ARCHIVE FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/m7/h1mg7c7x40ddjz6mxjxm3htr0000gn/T/flutter_tools.TDA8uV/flutter_ios_build_temp_dirVLpaDD/temporary_xcresult_bundle
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
error: No profiles for 'fun.gatch.chat.example' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'fun.gatch.chat.example'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/m7/h1mg7c7x40ddjz6mxjxm3htr0000gn/T/flutter_tools.TDA8uV/flutter_ios_build_temp_dirVLpaDD/temporary_xcresult_bundle
Error (Xcode): No profiles for 'fun.gatch.chat.example' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'fun.gatch.chat.example'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
It appears that there was a problem signing your application prior to installation on the device.
Verify that the Bundle Identifier in your project is your signing id in Xcode
open ios/Runner.xcworkspace
Also try selecting 'Product > Build' to fix the problem:
Encountered error while archiving for device.
My problem was that the values for APP_STORE_CONNECT_KEY_IDENTIFIER, CERTIFICATE_PRIVATE_KEY were wrong.
This was a little tricky, because the message for this printed out in the step where I set up the keychain. The error messages give you a concrete reasoning why the signing is failing, like:
GET https://api.appstoreconnect.apple.com/v1/bundleIds?limit=100&sort=name&filter%5Bidentifier%5D=bundle.id&filter%5Bplatform%5D=IOS returned 401: Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens
app-store-connect: error: argument --certificate-key: Provided value
app-store-connect: error: argument --private-key: Provided value is not a valid PEM encoded private key

I think I have done necessary code signing work but build still failing in Ionic

Building an Ionic app to try and test on my iPhone. I downloaded XCode last night and went in and created a profile with my Apple ID, as well as changing the bundle identified in the "General" and "Signing & Capabilities" tab. However when I run "ionic cordova build ios --prod" I get the error:
error: No profiles for 'io.ionic.starter' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'io.ionic.starter'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'MyApp' from project 'MyApp')
** ARCHIVE FAILED **
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.
cordova build ios exited with exit code 65.
Re-running this command with the --verbose flag may provide more information.
It seems to me as though I have done the necessary code signing procedures that I read from Ionic's website, so I am unsure why it still isn't working.
To run the app in your iPhone there are several steps, check these:
You have created your app ID in the website.
You have created your provisioning profile in the website, and downloaded to your computer and added to your Mac (web -> download profile -> double-click)
You have created a development certificate (search how to create a certificate using a Certificate Signing Request generated in your Mac ) and then downloaded that certificate and added to your Mac.
There are two certificates. Distribution certificate is used to publish the app, but development certificate is used simply to run the project in your iPhone, you need that.
But honestly, it's all much easier if you use XCode instead of the console. In the console run the command without --prod, to apply ionic changes to the iOS project. Then if you want to run the app, it's easier if you open XCode and just click play.
With XCode there's the option "Automatically manage signing" that will handle most of this for you automatically. You just have to login to your account using XCode (it will prompt you) and let it do it for you.

Command xcodebuild failed with exit code 70 - Nativescript

I'm using Nativescript (using VScode) and trying to upload my app in App Store Connect following steps from official {N} documentation. When I'm done with all steps: set Bundle ID, edit Info.plist and build.xcconfig, create distribution certificate, app identifier, provisioning distribution profile. I run the following command in VS code:
tns publish iOS *My_Apple_ID* *My_Apple_Password* *Provisioning_Profile_UUID* iPhone Distribution --appleApplicationSpecificPassword *password_for_two_factor_auth*
and then I get this error:
Error Domain=IDEProvisioningErrorDomain Code=9 ""nsvue.app" requires a
provisioning profile." UserInfo={IDEDistributionIssueSeverity=3,
NSLocalizedDescription="nsvue.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
My question is:
What I'm doing wrong? How to make it work?
Here's in detail what I had done so far:
Certificates, Identifiers & Profiles
Distribution certificate generated by Xcode
Registered App Identifier (BundleID) is "com.nativescript.nsvue" (my app's name is "nsvue" and I had tried BundleId to be same as the app name, but without success same error again)
Provisioning profile (where the REAL problem is) name of the provisioning profile with App ID - "My_Development_Team.com.nativescript.nsvue". Then I dowloaded it and installed it on my Mac.
App Store Connect
Create app with same BundleId as my app's and prepare it for submission now only I need to upload my app in App Store Connect
Package.json, Info.plist and build.xcconfig
Thats how my Info.plist looks like. And that's build.xcconfig. Id of my app in package.json is "com.nativescript.nsvue" too.
There is a related issue in the NativeScript GitHub Issues: https://github.com/NativeScript/nativescript-cli/issues/3222
While I'm not 100% sure why this problem exists, I have found that you can work around the problem by explicitly passing your provisioning profile uuid on the command line with the --provision flag, like this:
tns appstore upload *My_Apple_ID* *My_Apple_Password* --appleApplicationSpecificPassword *password_for_two_factor_auth* --provision *Provisioning_Profile_UUID*
Note: I think tns publish has been replaced with tns appstore upload...but under the covers, I think they're the same command...FWIW
Hope this helps as a work around for others that find this thread.

"No valid iOS code signing keys found in keychain"

I want to test an iOS application using Xamarin Test Recorder using iOS simulator. To do that I want to publish the project. When trying to publish it for archive, I got this error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com. (MobileApp1.iOS)
Do we need a certificate to publish the project?
When I drag and drop the .app to simulator it doesn't get installed. When I tried to install debug version it gives below error. Failed to chmod /Users/../Library/Developer/CoreSimulator/Devices/8A0508B3-0‌​2E8-4601-A239-B6712F‌​67FF4D/data/Library/‌​Caches/com.apple.con‌​tainermanagerd/Bundl‌​e/Application/1B8A7B‌​17-D9D0-44A6-8584-65‌​7FF1AB5815/MobileApp‌​1.app/MobileApp1 : No such file or directory" Release app also not get installed(No error or warning). Note that this is a xamarin project.What shall I do now?
First of all you do not need to sign/publish your app to use it with Test Recorder.
You can start recording tests from .app located on bin/iPhoneSimulator/Debug/ folder.
The “No valid iOS code signing keys found in keychain” happens when there are no provisioning profiles on your machine. The easiest fix is to create a new app from XCode and deploy it on the device, XCode will automatically downloads the required profiles and certificates

TeamCity 8 xcode 5 agent code sign error

I am trying to run Xcode using TeamCity but I am getting a Code Sign error. Even though the provision profile and certificate exists on my machine. I can build it on my iPhone. This is the error I am getting:
Step 1/1: Xcode Project [09:36:16][Step 1/1] PRAnalytics (CLEAN)
[09:36:16][PRAnalytics (CLEAN)] [BEROR]Code Sign error: No matching
provisioning profile found: Your build settings specify a provisioning
profile with the UUID “8A7A8B79-####-####-####-C39537A6A156”, however,
no such provisioning profile was found.
[09:36:16][PRAnalytics (CLEAN)] [BEROR]CodeSign error: code signing is
required for product type 'Application' in SDK 'iOS 7.1'
[09:36:16][Step 1/1] Code Sign error: No matching provisioning profile
found: Your build settings specify a provisioning profile with the
UUID “8A7A8B79-####-####-####-C39537A6A156”, however, no such
provisioning profile was found.
[09:36:16][Step 1/1] CodeSign error: code signing is required for
product type 'Application' in SDK 'iOS 7.1'
[09:36:16][Step 1/1] Step Xcode Project failed
I was able to solve this issue, which was due to two main reasons, Xcode when invoked from teamcity looks its resources from the System & not the user, so to fix at least get sure that you did the following:-
1-Ensure the project is building successfully from Xcode to real target.
-In KeyChain
2-Copy all the development certificates & credentials form your user folder to the system folder
3-Copy all the Provisioning profiles existing in
Users//Library/MobileDevice/Provisioning Profiles
to
System/Library/MobileDevice/Provisioning Profiles
Create the missing folders if they don’t exist below 'Library'
Finally figured out. My agent was in HD/AGENT. When i moved it to HD/USER/DESKTOP/AGENT, it began to work. Seems like Agent should be in the USER directory.
Have you checked build settings properly. Check your plist for identifier. And provisioning profile and code signing settings in Build settings. Make sure you are setting right provisioning and certificate.

Resources