Can't automatically archive Xcode 8 project through command line - ios

I'm trying to archive an Xcode project using xcodebuild archive (Xcode 8.2.1) (command line) and a .xcconfig file with the following content:
CODE_SIGN_IDENTITY = iPhone Developer
DEVELOPMENT_TEAM = [Team name here, removed]
SWIFT_VERSION = 2.3
This is the output I am getting
=== BUILD TARGET Unity-iPhone OF PROJECT Unity-iPhone WITH CONFIGURATION Release ===
Check dependencies No profiles for '[bundle id here, removed]' were
found: Xcode couldn't find a provisioning profile matching
'[bundle id here, removed]'. Code signing is required for product type
'Application' in SDK 'iOS 10.2'
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies (1 failure)

You will need a developer certificate, a developer provisioning profile and the distribution certificate and distribution provisioning profile when archiving through xcodebuild, but that still may not be the cause of the check dependency error.

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

How to choose an iOS provisioning profile command line while using Qmake to build

I am building my QtApp command line for iOS with qmake command like so:
qmake MyApp.pro -spec macx-ios-clang CONFIG+=iphoneos CONFIG+=device CONFIG+=$release
But I am getting a code signing error after compilation succeeds:
MyApp requires a provisioning profile. Select a provisioning profile for the "Release" build configuration in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
The signing works if I choose the required provisioning profile from Xcode UI but I need to do this command line using Qmake.
How can I choose a provisioning profile command line with qmake command ?
PS: I have multiple provisioning profiles in Xcode. This is possibly happening due to this?

Phonegap build Error code 65

I am using adobe phone gap build (https://build.phonegap.com) and i get this error:
=== BUILD TARGET Firstapp OF PROJECT Firstapp WITH CONFIGURATION Release ===
Check dependencies Provisioning profile "iOS Team Provisioning
Profile: com.OgonLabs.test2" is Xcode managed, but signing settings
require a manually managed profile. Code signing is required for
product type 'Application' in SDK 'iOS 10.1'
** ARCHIVE FAILED **
The following build commands failed: Check dependencies (1 failure)
Error code 65 for command: xcodebuild with args:
-xcconfig,/private/project/cordova/build-release.xcconfig,-workspace,Firstapp.xcworkspace,-scheme,Firstapp,-configuration,Release,-destination,generic/platform=iOS,-archivePath,Firstapp.xcarchive,archive,CONFIGURATION_BUILD_DIR=/private/project/build/device,SHARED_PRECOMPS_DIR=/private/project/build/sharedpch
I generate my .p12 certificate and then I make an app with id = "com.myCompany.test2" in Xcode and i generate provisioning profile. The same id has phonegap app. Any solution?
Remove another account added in your Xcode After that build with latest Provisioning Profile. and also check download all latest profile and certificate from xcode->windows->organizer->select account and download all certificate.

How to sign for phonegap osx local build

I have just started out with osx to start deploying locally to my iphones.
I have NPM installed, I can create projects with no problem, however I can't deploy to my devices. O, also I have xcode installed.
Build settings from command line:
ARCHS = armv7 armv7s arm64
CONFIGURATION_BUILD_DIR = /Users/hutber/myapp/platforms/ios/build/device
SDKROOT = iphoneos7.1
VALID_ARCHS = armv7 armv7s arm64
Build settings from configuration file '/Users/hutber/myapp/platforms/ios/cordova/build.xcconfig':
CODE_SIGN_IDENTITY = iPhone Developer
=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET Sex Diaries OF PROJECT Sex Diaries WITH CONFIGURATION Debug ===
Check dependencies
Code Sign error: No matching codesigning identity found: No codesigning identities (i.e. certificate and private key pairs) matching “iPhone Developer” were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Really no clue and I can't find anything in the documentation either...
If you don't have Apple Developer Account (paid). You can't deploy app to the phone or .ipa file, just iOS Simulator.
Also try https://github.com/nomad/shenzhen
The easiest way would be to open the Xcode project in Xcode, and let it handle the signing (or at least point out what you're missing; you do have a developer account, right?).
In the platforms/ios directory, there should be an Xcode project file, which you can open from Xcode. Note that any edits you make will be overwritten the next time you build for iOS from phonegap (it takes the common code & writes it to the various platforms), so you'd still have to build the way you have before.

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