When building for either Simulator or device, everyhing works. Here's a build report.
When archiving project, I get an error:
ld: framework not found Pods_iOSApp_MyApp
which is understandable because when looking at the Release.iphoneos folder, .framework is not there. When reviewing the archive report I see that the lines which should build the framework do not appear.
I am trying for days now, to find the cause of this issue. Tried everything I could find either here or on SO.
pod deintegrate & install (multiple times), clean build, nuked derived data etc.
Using Xcode 11.2.1.
Archive to succeed.
Archive failed.
CocoaPods : 1.8.4
Ruby : ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]
RubyGems : 3.0.6
Host : Mac OS X 10.14.6 (18G1012)
Xcode : 11.2.1 (11B500)
Git : git version 2.17.0
Ruby lib dir : /usr/local/Cellar/ruby/2.6.5/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
Executable Path: /usr/local/bin/pod
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.4.1
cocoapods-try : 1.1.0
use_frameworks!
abstract_target 'iOSApp' do
platform :ios, '11.0'
# Core Data stack
pod 'Ambar', :git => 'https://github.com/radianttap/Ambar.git'
# Auto Layout helpers in code
pod 'TinyConstraints', :git => 'https://github.com/radianttap/TinyConstraints'
# Image Cache
pod 'Kingfisher', :git => 'https://github.com/radianttap/Kingfisher.git'
# JSON parser
pod 'Marshal', :git => 'https://github.com/radianttap/Marshal.git'
# CommonCrypto wrapper
pod 'Arcane', :git => 'https://github.com/radianttap/Arcane.git'
# Keychain wrapper
pod 'KeychainAccess', :git => 'https://github.com/radianttap/KeychainAccess.git'
# Obj-C based PageViewController replacement
pod 'SCPageViewController', :git => 'https://github.com/radianttap/SCPageViewController.git'
# CleanroomLogger
pod 'CleanroomLogger', :git => 'https://github.com/radianttap/CleanroomLogger.git', :branch => 'cocoapods'
# Zip utility
pod 'Zip', :git => 'https://github.com/radianttap/Zip.git'
# JWT generation is needed for Video streaming
pod 'JSONWebToken', :git => 'https://github.com/radianttap/JSONWebToken.swift.git', :branch => 'podspec'
# Voucher, for login into tvOS using iOS app
pod 'Voucher', :git => 'https://github.com/radianttap/Voucher.git'
# AppCenter
pod 'AppCenter/Analytics'
pod 'AppCenter/Crashes'
# Firebase
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'
# Targets
target 'MyApp'
end
abstract_target 'watchOSApp' do
platform :watchos, '5.0'
pod 'Ambar', :git => 'https://github.com/radianttap/Ambar.git'
pod 'Marshal', :git => 'https://github.com/radianttap/Marshal.git'
pod 'Arcane', :git => 'https://github.com/radianttap/Arcane.git'
pod 'KeychainAccess', :git => 'https://github.com/radianttap/KeychainAccess.git'
pod 'CleanroomLogger', :git => 'https://github.com/radianttap/CleanroomLogger.git', :branch => 'cocoapods'
pod 'Zip', :git => 'https://github.com/radianttap/Zip.git'
# Targets
target 'MyAppwatch Extension'
end
Unfortunatelly this project is way too complex to cleanup and post as example. Note that this project is about 4 years old, fully updated to Swift 5, was archiving just fine about 5 months ago with the cococapods 1.7.2, if I remember correctly.
Since then, cocoapods was upgraded to latest version and Xcode is updated.
TL;DR: Podfile had platform set to iOS 11, while the minimum deployment target in the project itself was iOS 10. Changing from 10 to 11 solved the issue.
It's probably useful to list troubleshooting steps that led me to figure the cause. I switched to Legacy build system to see would it archive properly. First tried build for generic iOS device and it threw this warning:
Target 'Pods-iOSApp-MyApp' of project 'Pods' was rejected as an implicit dependency for 'Pods_iOSApp_MyApp.framework' because its architectures 'arm64' didn't contain all required architectures 'armv7 arm64'
This was rather confusing so naturally ducked[^1] it, which yielded this answer on SO
Also make sure that your podfile targets the same iOS version your project targets
After matching up the versions, both Legacy and Modern Build system produce a proper archive.
Most helpful comment
TL;DR: Podfile had platform set to iOS 11, while the minimum deployment target in the project itself was iOS 10. Changing from 10 to 11 solved the issue.
It's probably useful to list troubleshooting steps that led me to figure the cause. I switched to Legacy build system to see would it archive properly. First tried build for generic iOS device and it threw this warning:
This was rather confusing so naturally ducked[^1] it, which yielded this answer on SO
After matching up the versions, both Legacy and Modern Build system produce a proper archive.