Issue while creating dynamic framework in Swift with carthage - ios

Hi Can any one help in resolving this issue.
I have created a dynamic framework in swift. My framework is referring some external frameworks like alamofire, xcglogger etc into my framework project. I am using carthage for this purpose.
It works perfectly. But when I create the framework and use it in another project its giving me error on my framework
Missing required modules : 'Alamofire','XCGlogger'
Can anyone help me in this.
I am using carthage 0.16.2
xcode 7.3.1
Swift

Related

"Error: Missing required module 'CryptorRSA'" after importing Swift framework

I have a Swift project with a target that we'll call 'ProjectTarget'. ProjectTarget depends on this 'CryptorRSA' framework, which was added to the project using Swift Package Manager.
CryptorRSA is imported into a few files (via 'import CryptorRSA') within ProjectTarget and everything is working swimmingly. ProjectTarget is then exported as a framework and imported into an Objective-C app. Now, the Obj-C app which is trying to utilize the ProjectTarget framework is saying "Missing required module 'CryptorRSA'". I added the CryptorRSA package directly to the Obj-C app via Swift Package Manager and that did not solve the issue.
It's probably worth mentioning that this was not an issue prior to Xcode 13. Any help would be much appreciated!
I've already checked several related posts on SO, including:
Swift app: “Missing required module” when importing framework that imports static library
Xcode: missing required module error
Swift Project: "Missing Required Modules" when import a modular framework

cannot build project with xcode 8 beta 6

I am getting following error after I add a library via carthage -
library name compiled with older version of Swift language (2.0)
than previous files (3.0) for architecture x86_64
I have tried it with Argo library. (https://github.com/thoughtbot/Argo)
I have selected the correct xcode version using xcode-select utility.
What could be the problem? Any help is greatly appreciated
Thanks!
From what I learned, looks like you can't have libraries written in different versions of Swift.
In my Obj-C project I had 2 libs installed with CocoaPods
I updated the first one using the swift3 branch on github, and I converted the second one with Xcode.
Everything is building properly now!
This is happening as you've included another library (via cocoa pods or by linking the library directly etc...) which is compiled (or being compiled) in swift 2.
I've seen this a lot with Cocoapods (and Carthage)

Swift framework integration - Xcode shows errors but compiles ok

I have created a Swift framework and I have integrated that framework into my project using Carthage. All the necessary steps mentioned on the Carthage github page have been completed.
When I use the framework classes in my main project code, Xcode throws up errors in the editor (red exclamations in the margin) for any framework type - Use of undeclared type .... However the project itself compiles fine and works perfectly with the framework functionality. Another related issue might be that I do not get any autocomplete suggestions for my framework code. The framework classes, structs etc have been marked public as necessary.
What step am I missing here - what do I need to do so that Xcode does not show those errors?
The framework code is written on Xcode 8 with Swift 2.3, the main project is being managed on Xcode 7.3.1 with Swift 2.3
Xcode 7.3.1 supported only till Swift 2.2. Please upgrade your project to Swift 2.3 in Xcode 8

How to distribute iOS swift framework without the source code using pods?

I have been trying to create a git repo with my framework and trying to distribute it using pods. I have written a podspec which downloads all the dependencies as well as my framework. The pod functions properly. I even imported the framework to the appDelegate of the sample project to test its functionality.
Now when I am using a class of that framework I am getting the following error
'MyClass' is unavailable: cannot find Swift declaration for this class
I have tried to build the project for both simulator and iPhone, but the result being the same.
Does anyone has insight on this one?

How do I use Realm in a Swift Playground?

So, I'm pretty new to XCode development, but I've read the documentation on how to import third party frameworks into a Playground in XCode 7.1.1, and the documentation on how to get started with Realm, using the Dynamic Framework method of installation.
At this point I have a workspace that contains an iOS project, the two .framework folders required by Realm, and a Playground project. I have built the workspace without errors.
I figured going through some of the Realm examples in the Playground would be a great way to get going, but doing a simple:
import RealmSwift
results in a "No such module 'RealmSwift' error. What am I missing?
You should install Realm with Cocoapods.
One good practice to adopt is using Cocoapods when using other librairies like this one when they support it. That way you always have control on the version you're using of this library.
Update: Realm Swift works with Swift Playgrounds now. You'll find an example in Realm's release zips (direct download).
Realm doesn't support Swift Playgrounds at the moment: https://github.com/realm/realm-cocoa/issues/938
I faced the same issue while playing with RealmSwift on a Playground. I create it under a single view iOS application. Fixed it after building my main target, as creates the dynamic framework to be linked into the Playground.
Working fine with Cocoapod installation, Swift 4.2, & Xcode 10.1
Try it yourself. https://github.com/sauvikdolui/RealmExploration

Resources