Kingfisher Swift Compiler error when Archiving - xcode

I'm using xCode 13 beta 4 and want to archive my project containing Kingfisher.
The app runs fine under iOS 15, however I get the following errors when I look to archive it. Anyone with an idea what I should do? Thanks!

If you are using Xcode 13, here is a workaround.
If you need to use Xcode 13 but cannot upgrade to v7, use the version6-xcode13 branch. However, you have to drop iOS 10 support due to an Xcode 13 bug.
pod 'Kingfisher', :git => 'https://github.com/onevcat/Kingfisher.git', :branch => 'version6-xcode13'

Having Xcode 13 upgrade, after pod update, I start getting the same issue as you, after a workaround, I found two ways:
Downgrade Kingfisher to 5.x like:
pod 'Kingfisher', '~>5.15.7'
OR
In Deployment Info, upgrade your iOS support version to 12.0
Waiting for any fix from Kingfisher, I opted for downgrading to 5.x

Using Kingfisher 7.0.0 beta version should solve it.
E.g. pod 'Kingfisher', '~> 7.0'

This script worked for me on Xcode 13
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end

Related

Swift Package Manager and Cocoapods together: Compiler errors in Swift Package after Cocoapod Pod addition

I am developing an iOS app using the ParseSwift SDK. When I set up my project I added ParseSwift via the Swift Package Manager, which worked like a charm. Server connection and saving and querying for data on the server all works and my app compiles in its current state.
To add online meeting capabilities I have been trying to add the JitsiMeet iOS SDK.
After trying to add it via Swift Package Manager, I read on the Jitsi forum that the preferred way of adding it to an existing project is via Cocoapods, and there are currently no plans of supporting the Swift Package Manager. After finding several questions about interoperability of SPM and Cocoapods here I was hoping it would be smooth sailing.
After some back and forth to make Cocoapods work with my M1, I then tried several different Podfile variants to successfully add the JitsiMeetSDK Pod to my project. These variants include:
adding or leaving out the platform part so it is assigned by Cocoapods
adding or leaving out use_frameworks!
installing with or without the post_install block (which is taken from the Jitsi documentation)
This is my Podfile:
platform :ios, '15.0'
target 'MyApp' do
use_frameworks!
pod 'JitsiMeetSDK'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
The short version is: this does not work. My app doesn't compile anymore.
Here is the strange part: while Cocoapods successfully adds the JitsiMeetSDK Pod, when I open the .xcworkspace file and try to compile it I now get tons of compiler warnings for the ParseSwift package that I added via the Swift Package Manager. These errors all concern Concurrency or features only available in iOS 15 - which should not be a problem, since I set the platform to ios, '15.0' in my Podfile.
The ParseSwift files are also annotated and do have checks for Concurrency, which is why I understand this error even less. (screenshots of compiler errors and annotations below)
Is there an order that I have to follow when it comes to adding packages (first Cocoapods, then SPM)? Or any App settings I need to change now that two package managers are in the mix? Any help is appreciated!
I am using
Xcode 13.1
Swift version 5.5.1 (arm64)
Cocoapods 1.11.2 (installed via Home-brew for M1 support)
ParseSwift SDK 2.5.0 (via SPM)
JitsiMeet SDK 4.0.0 (via Cocoapods)
Here is a screenshot of the error messages (one example of almost 300 such cases):
So, I used your Podfile with a new project and ended up with the exact same result.
Then I tried first run Cocoapods for JitsiMeetSDK, then adding the ParseSwift with SPM. Same result.
The only way I was able to make it work was by having Cocoapods install both ParseSwift and JitsiMeetSDK.
platform :ios, '15.0'
target 'TestPackageManagers (iOS)' do
use_frameworks!
pod 'JitsiMeetSDK'
pod 'ParseSwift'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
pod install ran like a charm and I was able to compile and run everything.
You mentioned you are using ParseSwift SDK 2.5.0 in Xcode 13.1. This isn't possible.
Xcode made changes related to backwards compatibility in Xcode 13.2+.
You can resolve everything easily by upgrading to Xcode 13.2+. If you look at the release notes for ParseSwift it says specifically:
Requires Xcode 13.2 or above to use async/await. Not compatible with Xcode 13.0/1, will need to upgrade to 13.2+. Still works with Xcode 11/12
Basically, ParseSwift 2.4.0+ requires Xcode 13.2+. If you want to use Xcode 13.1 or lower, you need to use ParseSwift 2.3.1 or lower. More info can be found in the PR that made the change.
You will face this same issue with any dependency that adds the async/await backwards compatibility for iOS13, so it's recommended to upgrade to Xcode 13.2+ sooner than later.
In addition, the problem isn't related to a mix of SPM and Cocoapods, these dependency managers have nothing to do with each other and you shouldn't have any issues using ParseSwift through SPM along with others in Cocoapods.
The described Concurrency errors were due to updating the ParseSwift package dependencies without updating Xcode to 13.2+ as #CoreyB pointed out.
Xcode 13.2 introduced other, unrelated bugs to my project but solved the Concurrency issue. The bugs were an Xcode 13.2 issue, and updating to Xcode 13.2.1 fixed these bugs.
After the update, I was able to add JitsiMeetSDK via Cocoapods to my existing project.
Thanks to #CoreyB and #Alex Kusmenkovsky for their helpful input!

Do I have to downgrade Cocoapods for Xcode 9 (GoogleDataTransport-error)

Hi I can't fix the error and I rely on you guys. I had to update some pods and therefore I updated my CocoaPods since then I get the
I am wondering if it is because of my Xcode 9.2 and SDK 'iOS 11.2' but updating Xcode is not an option. I tried to delete pods, xcworkspace, Podfile, podfile.lock and delete /Users/XXXX/Library/Developer/Xcode/DerivedData but it did not work...
any suggestions how I can fix the issue

Alamofire 4.0.0 erorr in Xcode 8 Beta 6

i'm using Xcode 8 beta 6 with swift 3 and i installing alamofire 4.0.0 beta 1 from cocoapods with using this code
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'swift3'
after installing, i open xcworkspace file but its erorr and Xcode ask for converting code from swift 2.2 to 3. I also set platform target to ios 9.0 but it's still not works. anyone can help? thanks

xcode 8 beta Alamofire compiler errors after pod update to 3.4.1

I have downloaded a legacy swift app using git and run pod update. After git add -A, I open the workspace using xcode 8 beta then Product -> Clean and build I get 40 swift compiler Alamofire errors. I have not run convert o swift 2.3 or swift 3.
Podfile.lock has version 3.4.1 for Alamofire.
in Podfile I set the version to ios 10.0 and in Alamofire info also set infoDictionary version to 10.0 but it made no difference.
Mostly they are syntax errors like NSURL needs to be renamed URL, etc.
I can't find any answers to this problem with Google.
Xcode 8 compiles against the iOS 10 SDK. This differs slightly from the iOS 9 SDK and thus the errors. You won't be able to use Xcode 8 with Swift 2.2 code.
If you look at the Alamofire branches, https://github.com/Alamofire/Alamofire/branches, you'll see work on 2.3 and 3.0 compatibility.
Also, read this thread for details on how to use those branches: https://github.com/Alamofire/Alamofire/issues/1312.

Run realm.io inside watchos2 extension

I try to migrate my existing Apple Watch app to watchos2 but fail to get realm.io running on the watchkit extension.
The Realm documentation describes how to get everything running with Swift 2.0:
use_frameworks!
pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-2.0'
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-2.0'
And on Realm news from end of June it was mentioned that watchos support is on the way with Pull Request 2139. It seems that changes in this PR are not merged into any branch.
When I run the watchkit extension with the swift-2.0 branch I get the following error:
dyld: Library not loaded: #rpath/Realm.framework/Realm
....
Reason: no suitable image found. Did find:
/.../DerivedData/Build/Products/Debug-iphonesimulator/Realm.framework/Realm: mach-o, but wrong architecture
Are there any plans to merge the watchos2 support soon and make it accessible? Or are there other recommendations or resources to get Realm running on the Apple Watch?
What versions of Xcode and CocoaPods are you using? I believe that CocoaPods actually needs some unreleased functionality to work completely with watchOS 2 apps, see https://github.com/CocoaPods/CocoaPods/pull/4004, which will be included in the upcoming 0.39 release.

Resources