Header 'MessageKit-Swift.h' not found - swift

I'm trying to setup MessageKit within my app. I've been researching and trying to resolve this for a week with no luck. I'm getting an error in the module.modulemap file saying
Header 'MessageKit-Swift.h' not found
I'm deleted dervied data, ran pod update, pod install, etc.
Here is the module.modulemap code
framework module MessageKit {
umbrella header "MessageKit.h"
export *
module * { export * }
}
module MessageKit.Swift {
header "MessageKit-Swift.h"
requires objc
}
I expected MessageKit to compile within my workspace.

I tried that pod in a test project and compiles fine without issues.
I'm using Cocoapods 1.7.2 and Xcode 10.2.1, and this is my Podfile:
target 'MessageKitTest' do
use_frameworks!
pod 'MessageKit'
end
Tried to compile the MessageKitTest from the generated xcworkspace - all good on my end.
Try running a pod deintegrate then a pod install again.

Related

No such module 'InputBarAccessoryView'

Trying to get MessageKit setup within my project. I'm getting the following error - 'No such module 'InputBarAccessoryView' within the
MessagesViewController+Keyboard.swift:26:8: No such module 'InputBarAccessoryView'
I've tried installing pods, updating pods and deintegrating.
import Foundation
import InputBarAccessoryView
Should compile normally. Only error that persists.
In My case i will update pod file Ios version
# Uncomment the next line to define a global platform for your project
platform :ios, '14.0'
target 'Messanger' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Messanger
pod 'InputBarAccessoryView'
end

Using static libraries in Swift with CocoaPods fails for Realm

Since Xcode 9 it is possible to use static libraries by omitting the use_frameworks! flag in the Podfile. However, when used with the Pod RealmSwift this results in the following error:
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `RealmSwift` depends upon `Realm`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
Sadly, the proposed solution with use_modular_headers! does not work.
Other things I have tried include:
Using the latest Realm version (3.15.0)
Use the Objective C version and add Swift support, this won't build and give a module not found error in the RLMSupport.swift file .
Adding a bridging header for the Objective C version.
Endless clean, rebuild, Xcode relaunches and Derived Data folder cleaning.
It would not be preferable to circumvent CocoaPods and have this dependency be installed in a separate way, since that would make updating a more complex process. I hope there is a solution that works with CocoaPods, Realm and Swift.
I did the job doing following:
pod 'RealmSwift', '~> 3.17', :modular_headers => true
pod 'Realm', '~> 3.17', :modular_headers => true
As far as I can tell adding use_modular_headers! to top of Podfile works.
Adding s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } to .podspec doesn't work as far as I can tell. (Cocoapods 1.6.0-beta.2)
example:
target 'Opportunity' do
use_modular_headers!
end
I don't see why it wouldn't work. I got the same issue, and I added use_modular_headers! following way in the podfile and it worked.
target 'Pick Up Lines' do
use_modular_headers!
pod 'RealmSwift'
end
By the way, before doing any of it, make sure, you set the deployment target of the project as 11.0.

Xcode error: Missing required module 'Firebase'

The problem:
I have a dynamic framework, which uses Firebase added by cocoapods. And I also have the App, which uses this dynamic framework. But when I try to build the project I got error Missing required module Firebase.
I tried the following:
remove derived data + clean
re-install pods
add 'Import paths' to the build settings (in this case I got error 'Library not loaded' in runtime)
My podfile:
target 'Project' do
...
end
target 'Framework' do
pod 'Firebase/Core'
pod 'Firebase/Auth'
end
The Framework is added to Embedded binaries and Linked Frameworks and Libraries.
For anyone still having this issue, doing this solved it for me.
Add this to your test target build settings.
HEADER_SEARCH_PATHS = "${SRCROOT}/Pods/Firebase/CoreOnly/Sources"
Full discussion can be found on firebase GitHub issues.
you can find HEADER_SEARCH_PATHS in Test Target > Build Settings > Search Paths > Header Search paths.
Just incase you cant find HEADER_SEARCH_PATHS in Build Settings, click the ALL button to show all settings.
Add the following to your test target:
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Firebase/CoreOnly/Sources"
That’s in test target > Build Settings > Header Search Paths.
After adding test target, running:
pod install
and add to:
HEADER_SEARCH_PATHS = $(inherited)
fixed for me.
On Framework Search Path pod put all pod projects path automatically.
Of course, to podfile added this after last pod name:
target 'TestTargetName' do
inherit! :search_paths
end
Nothing did help to me until
target 'TestTargetName' do
pod 'Firebase/Storage'
end
I'm not sure what firebase does so I can't run tests (tests do not depend on firebase at all)

Xcode does not see framework installed via cocoa pods

I am trying to add the SharkORM framework to my application but somehow after installing pod which looks like :
target 'XXX' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for XXX
pod 'Firebase/Core'
pod 'SharkORM'
target 'XXXTests' do
inherit! :search_paths
# Pods for testing
end
target 'XXXUITests' do
inherit! :search_paths
# Pods for testing
end
end
and using command pod install; getting this :
Analyzing dependencies
Downloading dependencies
Using Firebase (3.12.0)
Using FirebaseAnalytics (3.6.0)
Using FirebaseCore (3.4.7)
Using FirebaseInstanceID (1.0.8)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.1)
Using SharkORM (2.1.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 8 total pods installed.
Which sounds great because the installation is succeed.
In the AppDelegate.swift getting error :
Use of undeclared type 'SRKDelegate' here :
class AppDelegate: UIResponder, UIApplicationDelegate, SRKDelegate {
I would say that i have to use import SharkORM on the top of my file but it does not shows me this file exist. It should - > Inside Pods file i have these components then what is going on ? As u can see I am using Firebase which is working.
Thanks in advance!
Install the framework
pod install
Open your workspace XXX.xcodeproj and create a bridging header. To create bridging header
//File -> New File -> Header File
//Save it as a YourApp-Bridging-Header
Compile the SharkORM framework target
Then include the framework header within your app, by adding this to the bridging header
#include <SharkORM/SharkORM.h>
import module import SharkORM in AppDelegate class
import SharkORM››
Add SRKDelegate in AppDelegate class
class AppDelegate: UIResponder, UIApplicationDelegate, SRKDelegate
You have to import SharkORM to use the pod. Also, make sure you're working on the .xcworkspace file in the same directory as the project (it's automatically created when you execute pod install.

Library not found for -lFirebase after installing XLForm

I have a project in Swift where I use some libraries. When I run on the simulators or on the physical device, it runs perfectly. But by the time I try to archive the project to send it to the store, I receive the following error message:
ld: library not found for -lFirebase
The problem is when I use the XLForm library, which was the last modification I have done to my Podfile.
I am using the .xcworkspace since I started using the CocoaPods, and I have never had any problem before.
My Podfile:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
pod 'Firebase', '= 2.5.0'
pod 'Google/CloudMessaging'
pod 'Google'
pod 'Google/Analytics'
pod 'XLForm', '~> 3.0'
target 'Dimmi' do
end
target 'DimmiTests' do
end
target 'DimmiUITests' do
end
The XLForm library does not depends on any other library or framework. Also, I tried to install it manually with no success.
You need to create a bridging header file and import the Objective-C framework through it.
Create a new header file and name it in the following pattern:
ProjectName-Bridging-Header.h
Then add your framework header to it
#import Framework.h
Then add the bridging header to your build settings under Objective-C Bridging Header.