iOS builds / ipa creation no longer works from the command line
Apple got back to me with a solution. As of Xcode 7 we should use xcodebuild
instead of PackageApplication
to produce the .ipa file.
xcodebuild has a new -exportArchive option to create an .ipa that works more like Xcode Organizer.
So we should now:
- build an archive with
xcodebuild archive
- create the .ipa with
xcodebuild -exportArchive
We now build the archive like this:
xcodebuild -workspace myApp.xcworkspace -scheme myApp -sdk iphoneos -configuration AppStoreDistribution archive -archivePath $PWD/build/myApp.xcarchive
We now export the .ipa like this:
xcodebuild -exportArchive -archivePath $PWD/build/myApp.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build
These two command create the files build/myApp.xcarchive
and build/myApp.ipa
Note that xcodebuild -exportArchive
requires a -exportOptionsPlist
argument that points to a .plist file with export options. For a complete list of what you can put in that plist, run xcodebuild -help
. The minimal contents of the file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>YOUR_TEN_CHARACTER_TEAM_ID</string>
</dict>
</plist>
In Xcode 9, you now have to specify more details in exportOptions.plist like below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>method</key>
<string>ad-hoc</string>
<key>provisioningProfiles</key>
<dict>
<key>my.bundle.identifier</key>
<string>My Provisioning Profile Name</string>
</dict>
<key>signingCertificate</key>
<string>iPhone Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>YOURTEAMID</string>
<key>thinning</key>
<string><none></string>
</dict>
</plist>
Failed to generate iOS ipa file
Got answer from Embarcadero Customer Support Center.
This "error" is connected with the CFBundleName/CFBundleDisplayName. If these parameters in the project's project option contains space characters, this error will occur.
I removed the spcace character off mu app name (ESF RC1--> ESF_RC1)
It works.
BTW, according to them, the bug had been fixed in Rad Studio 11.
Not able to create IPA using xcodebuild command through jenkins shell script
Keychain was locked on Jenkin server thats why it was not able to code sign.
Unlocked it with below command before xcodebuild
command
security unlock-keychain -p yourPassword
Now its working good.
error Failed to build iOS project. We ran xcodebuild command but it exited with error code 65
If you don't have cocoa pods installed you need to sudo gem install cocoapods
- run
cd ios
- run
pod install
cd ..
- delete build folder
- run
react-native run-ios
if the error persists,
- delete build folder again
- open the
/ios
folder in x-code - navigate File -> Project Settings -> Build System -> change (Shared workspace settings and Per-User workspace settings): Build System -> Legacy Build System`
You should be good to go.
build .ipa from terminal issue with provisioning profile
The answer was here: xcodebuild error: no provisioning profile matches (the one marked as correct).
It is bit confusing. Basically, it doesn't matter what UUID or provisioning file name is in your machine locally. You need to go to https://developer.apple.com/account/ios/profile/production and copy what is next to name label(copy the name).
Or you can find ir under name tag in the file in the provisioning files directory on your machine.
EXPORT FAILED error using xcodebuild command line tool
The old way to do it seems to do the job.
xcodebuild -exportArchive -archivePath $XCODE_ARCHIVE -exportPath $EXPORT_PATH -exportFormat ipa -exportProvisioningProfile "$PROVISIONING_PROFILE" -configuration $CONFIGURATION
where $PROVISIONING_PROFILE
is for example iOS Development
. The archive is created correctly. The shell will print out a deprecation log. You can safely ignore it.
The new way, introduced with Xcode does not work (at least for me). See xcodebuild's new exportOptionsPlist flag.
If you have any hint to use the new way, please post it.
Edit
There is an open radar for it Open Radar. In addition, also Fastlane provides a fallback mechanism for this problem (see Export Failed with Xcode 7 - No applicable devices found).
Flutter : Failed to build iOS app ARCHIVE FAILED,Encountered error while archiving for device
The problem here is that the Podfile that Flutter template creates by default has no specific iOS version set unfortunately.
Do this to fix this problem:
- in
ios/
folder of your project, open thePodfile
. - At top of
Podfile
, make sure this line is not commented out and change the iOS version to 12.0.
change from:
#platform :ios, '8.0'
to:
platform :ios, '12.0'
Run
pod deintegrate
in Terminal inside theios/
folder of your project.Run
pod install --repo-update
in yourios/
folder
This should do the trick!
If after this you are getting the following error
CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target
Then you need to open your iOS workspace in Xcode and select your root project on top left, then inside the Info tab, choose your configuration (in this case Debug) and change it to None. After that, do pod install again.
Related Topics
Using an Avplayer Returns a "Non-Multipath Connection" Error
How to Add More Cases for Enum in Swift
Which Optimization Level Should I Choose for Release
Add UIview (From Xib) with Transparency to Scenekit
Using Getters and Setters to Modify Values W/O Subclassing in Swift
Using Dateformatter with Timezone to Format Dates in Swift
Borders Not Covering Background
How to Refresh The Google Map in My Application Using Swift
Quick Sort in Swift Is Giving Error
Parametrized Unit Tests in Swift
Wkwebview Won't Load (Nsviewcontroller, Os X)
Naming Convention for Private Properties
Issue with Returning a Directory Enumerator from Nsfilemanager Using Enumeratoraturl in Swift
Geocodeaddressstring Not Working for Swift
Why This Line Is Not Covered? Xcode Code Coverage
Enum Named 'Type' in Nested Class Fails
Create a Generic Swift Function to Return an Array of Core Data Entities