Cannot import framework file in custom framework in iOS - ios

I am creating a custom framework in iOS. I have a built-in framework as shown in the image. When I try to import a file from an already created framework (Ex,smma) I get the error "smma.h" file not found. Any help will be appreciated.

I also had some issues with creating my own framework and including it in a project. I found Kodmunki had a really useful guide.
https://kodmunki.wordpress.com/2015/09/22/ios-9-universal-cocoa-touch-frameworks/
Pay particular attention to the section on Adding Frameworks to an App. This was where I was making mistakes. Once I followed the steps in this section I found it was working correctly.

Related

Missing required module 'MLKit' error while using a framework that uses MLKit

Recently I created a iOS Framework called "MLKit Framework" that uses MLKit Face Detection library. In order to achieve that, I just imported the library in Podfile
according to documentation.
As expected, that created a xcworkspace called MLKit Framework. In order to test that new framework, I created an app called MLKitApp and added that app to the same workspace. Then I added the framework MLKitFramework to that app and tried to build it but I get the error statement: "Missing required module 'MLKit'"
as the image below.
Why Am I getting that error? What I'm doing wrong?
Reproducible Example
I created a Reproducible Example here. In order to execute that example execute the following:
Execute pod install for MLKitFramework;
Add MLKitApp to MLKitFramework.xcworkspace;
Add MLKitFramework.framework as a MLKitApp Frameworks, Libraries and Embedded Content;
Try to build MLKitApp.
And voilà
You can't do this because your's "MLKitFramework" have dependency to MLKit.
You should add MLKit framework to MLKitApp additionally.
Have you checked out the ML Kit Vision Quickstart? Please note it contains two apps: one for swift and another for objective-c. You check check out the swift app for your purpose - it contains face detection feature. The Vision Quickstart is similar to your MLKitApp and shows you an example how to integrate with ML Kit cocoapods directly without needing to introduce an "MLKitFramework" or manually manage dependency configuration. Instead, you should let CocoaPods manage that. You can use this Quickstart as a template for implementing your own app.
I don't now if this helps after all this time, but for future references here it goes:
Google hides the header, so you have to manually specify the header you want to add so your test can find it.
If you go to: Project> targets YourProjectTest > Build Settings > Search Paths > Header Search Paths and add:
"${PODS_ROOT}/Path-to-the-Header-in-your-Pods-Folder/Soucers"
In my case it was:
"${PODS_ROOT}/GoogleMLKit/MLKitCore/Sources"
It worked big time for me.
I hope it helps :)

Google Speech To Text Api using Objective C

I am using GoogleSpeechRecongnization api within my project for Speech To Text.
I have copied all required files and installed pod from sample of Google for Speech To Text Api. Also copied these 2 files AudioController, SpeechRecognitionService from the Sample Code to implement the feature.
Now when I compiled my code, I received errors as in attached image.
While same steps and files are working perfectly in demo app with the custom interface, created by me.
Please help me to fix these in my main project. Thanks
The SpeechRecognitionService require google service to be linked which lies in the google folder of the sample Project, please add that too in your project, it should be working..
See where is google folder here
Cheers.
Check demo project supported architectures in build settings...
I think you need to add missing architecture in your build settings
Maybe it's in your project and maybe it's in the Pods project

Importing Firebase Framework manually in Xcode 8 (Swift 3)

I'm trying to import Firebase Storage into my Xcode project. I followed this guide.
I only imported the actual .framework file from the downloadable client library, along with all the other required frameworks and files, listed in the link above (the two .dylib files either do not exist anymore or have been renamed to something else, so the documentation is definitely outdated).
I'm guessing this isn't sufficient to get the Framework running in my Xcode project, as I did get an error that Firebase wasn't a recognized module. If it's all the other files (a few .h files, .module file and a info.plist file) I need to import as well, I was wondering how to do this in a Swift-written project?
Also, do I need all the files, or just some of them? The instructions in the documentation are very useless (probably because they're outdated), so I'm hoping someone with experience importing the framework into Xcode 8 (Swift 3) can give me some instructions. The documentation makes the importing process sound so easy, but I'm pretty sure it's a little more complex than that.
That guide is for our old client library (the deprecation warning at the top of the page confirms your suspicion that the docs are out of date :).
Instead, you'll want to use: https://firebase.google.com/docs/ios/setup#frameworks
You'll need FirebaseAnalytics.framework (to get FIRApp) as well as FirebaseDatabase.framework and Firebase.h. I believe we've got modulemaps properly working there, so you shouldn't have to mess with linker flags or other libs, as the modulemaps will include them properly.

Adding a custom Framework to an Xcode project

I decided to try to make a Cocoa Touch Framework. Making it worked fine, but I am having trouble adding it to a project. After searching through a lot of SO posts and looking at Apple Forum threads I decided to try this from the Docs:
Add a framework bundle to a project in order to incorporate the
framework’s features into your product.
In the project navigator, select the project or group within a project
to which you want to add the framework.
Choose File > Add Files to “”.
Select the framework bundle, and click Add.
The frameworks you add this way are third-party-built bundles
containing the framework’s object code and runtime resources. See
related articles for information about linking to a framework without
adding it to the project.
After you add the framework, Xcode configures the targets in your
project to link them to the framework just added.
It still doesn't work. I am getting a No such module 'Scaffold' error for everything I try, I have checked spelling, but that is not it. Can someone explain how this works? I might just need clarification on how this is done.
Links I have looked at:
Create and import swift framework
Xcode error when I add a framework
Adding a framework to XCode 4
Xcode 5.1 compiler errors after adding a framework
Add a framework to an existing project without using cocoapods
What is the process for creating a Framework?
Hey I do not know if it is too late to answer this question, but due to the fact that I am facing same issues right know I would recommend you to check the Build Settings of the project where you import your framework
You should check the "Framework Search Path" and if the framework is at Swift and you import to an obj c project check YES to "Always embed swift standard libraries"
More or less the problem I think is in the Build Settings

DBRestClient.h not found for CDEDropboxCloudFileSystem (ensembles framework)

I'm trying to implement Dropbox syncing to my iOS app using the ensembles framework. I'm not using pods, so I manually added the ensembles iOS and DropboxSDK Xcode projects to the frameworks section of my project, and made sure all the buildphases etc are taken care of (following the instructions on the ensembles github page). No problems so far, everything builds fine. But when I then add CDEDropboxCloudFileSystem to my project (see here), I get an error saying that DBRestClient.h cannot be found. I fixed it by replacing #import DBRestClient.h with #import <DropboxSDK/DropboxSDKh.h> in CDEDropboxCloudFileSystem.h and commenting out the two DropboxSDK related imports in CDEDropboxCloudFileSystem.m
Builds fine now, but is this the correct solution, or did I miss something with my setup?
(I tried adding the ensembles tag to this question, but I need a reputation of at least 1500 to do so)
If it builds, your solution is probably fine.
I guess whether you can import the framework header or not depends on how you are linking. Sounds like you are somehow linking a Dropbox framework on iOS. Is that right?
That might be a new option Dropbox have added for iOS 8. Previously, on iOS, you basically linked with a static library, and then you don't have the option.
Another way around the issue may be to add the path to the Dropbox headers folder to your header search path.
PS I also don't have the points to add an 'ensembles' tag :(

Resources