kandi X-RAY | Carthage Summary
kandi X-RAY | Carthage Summary
Carthage is intended to be the simplest way to add frameworks to your Cocoa application. Carthage builds your dependencies and provides you with binary frameworks, but you retain full control over your project structure and setup. Carthage does not automatically modify your project files or your build settings.
Top functions reviewed by kandi - BETA
Carthage Key Features
Carthage Examples and Code Snippets
Trending Discussions on Carthage
We are trying to migrate our code from XCode 12 to 13. Our code and all dependencies were compiling on XCode 12.
However, since we moved to XCode 13 our unit test target is not compiling. We are using the following:...
ANSWERAnswered 2021-Nov-23 at 00:26
Have you set your
xcode-select to Xcode 13?
I'm encountering an issue regarding my iOS SDK and how it retrieves and display images (from the bundle assets) when the app is downloaded from Testflight.
The SDK can be integrated via SPM, Cocoapods and Carthage. This issue is all about the Cocoapods integration.
Locally, even as a release build and when run on a device, everything runs fine and the images are being displayed:
When build locally with "Release" build configuration, the icon shows. And when the exact same app is archived and then downloaded via Testflight, all icons are gone.
This is how I retrieve the image from the bundle:...
ANSWERAnswered 2022-Feb-04 at 12:02
I found out that this question has the exact same problem:
The problem is, that the bundle has the same name as the module. Changing the bundle name to something else fixes the issue, see my answer there: https://stackoverflow.com/a/70986055/4755172
While building my project, I get this error:...
ANSWERAnswered 2022-Jan-26 at 08:15
This means that on an M1 Mac, Carthage is probably found at
Your build script should use something like
$(which carthage) or simply
carthage instead of relying on an absolute installation path.
I am currently working in switching dependency manager of a project from Carthage to Swift Package Manager,
We have for example realm dependency that used to be a dynamic framework when building with Carthage,
But in SPM when I try to add realm it by default gives a realm static framework and I could not find a way to switch to dynamic,
Since we have some submodules in our project dependent on each other trying to link the static library gives
duplicate symbols errors.
I would be much easier if I could download realm directly as dynamic framework as I can get with Carthage,
Does anyone knows how to do that?
Thanks in advance for any help :)...
ANSWERAnswered 2022-Jan-22 at 10:57
Packages can produce dynamic libraries but they have to explicitly tell Xcode that they want the library to be made into a dynamic library. Realm does not do this. Instead, the folks at Realm go with the default behavior which lets Xcode decide which whether it will construct a static or dynamic library. As far as I know, Xcode always chooses to build a static library.
To get around this you can create your own package that includes the Realm package as a dependency and explicitly make your library dynamic. You can find plenty of tutorials that show you how to make a package so I won't get into that here.
If you create a package and load the following content into your Package.swift file, then import the package into your project, you will have solved your problem. I named my package "RealmUmbrella" but you can call yours whatever you like.
I am trying to authenticate into my MongoDB Realm app anonymously through the Realm iOS SDK, but I am getting the following error:...
ANSWERAnswered 2021-Sep-28 at 21:49
I figured out the problem. When creating the realm app like below:
I just moved my Xcode project to use Carthage instead of CocoaPods as my dependency manager, so I am trying to update my GitHub Actions CI workflow to download the dependency binaries.
However, after running
carthage bootstrap --platform iOS --use-xcframeworks in my workflow, it eventually gives the output and error:
ANSWERAnswered 2021-Sep-27 at 22:39
I figured it out! It turns out you need to specify the
GITHUB_TOKEN as an environment variable when running the
carthage bootstrap command. Here's the updated step in my workflow:
Hello. I recently encountered swiftlint and learned this. But there's a problem. I modified the Identifier Name of swiftlint to maintain the CalmelCase grammar, but it didn't work.
this is my .swiftlint.yml text....
ANSWERAnswered 2021-Aug-28 at 01:50
You have changed the rules for identifiers but the rule that is triggering is for type names.
Type names should start with an uppercase letter.
Change your class name to
I am trying to setup a tracking library written in Kotlin Multiplatform to support all our mobile clients.
Tests for Android went well (integrating snowplow via gradle).
I also managed to integrate Snowplow via cocoapods into the MPP....
ANSWERAnswered 2021-Aug-06 at 11:38
I am having an issue with GitHub Actions. When I call
productsign the job just hangs. When searching the internet it seems that the job tries to ask the user for a password but I do not get any errors or feedback from the logs. The job just hangs for ever. When run on my own computer everything works as expected and the .pkg is signed.
My step in the workflow is as follows...
ANSWERAnswered 2021-Jul-29 at 14:41
Ok, we finally figured it out. The solution is to create tmp keychain, set its as default and configure some attributes. This makes sure
productsign can access it without being prompted for a password.
Setup Tmp Keychain
No vulnerabilities reported
Get Carthage by running brew install carthage or choose another installation method
Create a Cartfile in the same directory where your .xcodeproj or .xcworkspace is
List the desired dependencies in the Cartfile, for example: github "Alamofire/Alamofire" ~> 4.7.2
Run carthage update --use-xcframeworks
A Cartfile.resolved file and a Carthage directory will appear in the same directory where your .xcodeproj or .xcworkspace is
Drag the built .xcframework bundles from Carthage/Build into the "Frameworks and Libraries" section of your application’s Xcode project.
If you are using Carthage for an application, select "Embed & Sign", otherwise "Do Not Embed".
We encourage using XCFrameworks as of version 0.37.0 (January 2021), and require XCFrameworks when building on an Apple Silicon Mac. Switching from discrete framework bundles to XCFrameworks requires a few changes to your project:. Xcode 12+ incompatibility: Multi-architecture platforms are not supported when building framework bundles in Xcode 12 and above. Prefer building with XCFrameworks. If you need to build discrete framework bundles, use a workaround xcconfig file. Along the way, Carthage will have created some build artifacts. The most important of these is the Cartfile.resolved file, which lists the versions that were actually built for each framework. Make sure to commit your Cartfile.resolved, because anyone else using the project will need that file to build the same framework versions. You can add a Run Script phase to automatically warn you when one of your dependencies is out of date. Carthage will check to make sure that downloaded Swift (and mixed Objective-C/Swift) frameworks were built with the same version of Swift that is in use locally. If there is a version mismatch, Carthage will proceed to build the framework from source. If the framework cannot be built from source, Carthage will fail.
Create a Cartfile that lists the frameworks you’d like to use in your project.
Run carthage update --use-xcframeworks. This will fetch dependencies into a Carthage/Checkouts folder and build each one or download a pre-compiled XCFramework.
On your application targets’ General settings tab, in the Frameworks, Libraries, and Embedded Content section, drag and drop each XCFramework you want to use from the Carthage/Build folder on disk.
On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:
If you encounter build failures in carthage build --no-skip-current, try running xcodebuild -scheme SCHEME -workspace WORKSPACE build or xcodebuild -scheme SCHEME -project PROJECT build (with the actual values) and see if the same failure occurs there. This should hopefully yield enough information to resolve the problem. If you have multiple versions of the Apple developer tools installed (an Xcode beta, for example), use xcode-select to change which version Carthage uses.
If you embed many dynamic frameworks into your app, its pre-main launch times may be quite slow. Carthage is able to help mitigate this by building your dynamic frameworks as static frameworks instead. Static frameworks can be linked directly into your application or merged together into a larger dynamic framework with a few simple modifications to your workflow, which can result in dramatic reductions in pre-main launch times. Since version 0.30.0 Carthage project rolls out support for statically linked frameworks written in Swift or Objective-C, support for which has been introduced in Xcode 9.4. Please note however that it specifically says frameworks, hence Darwin bundles with .framework extension and statically linked object archives inside. Carthage does not currently support static library schemes, nor are there any plans to introduce their support in the future.
You still need to tick your Carthage-compliant project's schemes as shared in Product > Scheme > Manage Schemes..., just as with dynamic binaries
You still need to link against static .frameworks in your project's Build Phases just as with dynamic binaries
In your Carthage-compliant project's Cocoa Framework target's Build Settings, Linking section, set Mach-O Type to Static Library
Your statically linked frameworks will be built at ./Carthage/Build/$(PLATFORM_NAME)/Static
You should not add any of static frameworks as input/output files in carthage copy-frameworks Build Phase
Swift static frameworks are not officially supported by Apple
This is an advanced workflow that is not built into Carthage, YMMV
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page