Showing posts with label frameworks. Show all posts
Showing posts with label frameworks. Show all posts

Monday, July 23, 2018

Create Native SDKs with React Native

Leave a Comment

I want to create client libraries for my backend for iOS and Android. They will be using native services like location services.

Instead of creating a seperate SDK for each, I was wondering if I would use react native to create the SDK, and then compile(eject) it to a native iOS pod or android aar library. Is this possible to achieve with react native, and if yes, how can this be achieved.

If not react native, then is there any cross platform framework which allows this?

1 Answers

Answers 1

If understood correctly, you want to develop react native libs then use in none react native projects. For example adding them to gradle or pods, But it's not available.

Because react native platform is different and needs bunch of other dependencies to be run. It's looks like running another engine inside the other one.

You can build SDK's based on Hybrid/Native frameworks and use them in those frameworks but you can't export them and use like native libraries(pod/gradle).

Except C++ programming for cross platform purposes, you should search in github or other repositories to find specific types of libraries that you need.

Read More

Thursday, February 1, 2018

ld: framework not found MCCMerchant_sandbox

Leave a Comment

I am trying to integrate Master card merchant SDK. I am following all steps as described but always fails with error framework not found.

https://developer.mastercard.com/page/masterpass-merchant-sdk-for-ios#

enter image description here

Below is the screen shot of my framework search path

enter image description here

Below is the error which I am getting when trying to add framework in Xcode project

enter image description here

1 Answers

Answers 1

First of all You need to be sure that framework included in linked libraries. Go to project settings and check it is listed in Link binary With Libraries section. enter image description here

Read More

Friday, March 10, 2017

using 'vendored_frameworks' and 'source_files' for cocoapod using 'use_frameworks!'

Leave a Comment

I'm building a cocoapod that basically contains a framework (private sources) and a view (open source) that rely on this framework, all made in Objective-C.

In the podspec I have the following lines :

  • spec.vendored_frameworks = 'MyPod/Framework/MyFramework.framework'
  • spec.source_files = ['MyPod/UI/Views/MyView.{h,m}']

When using the use_frameworks! syntax, I can't #import MyFramework

I just don't understand what's happening.

Moreover, when I remove the spec.source_files line, I can #import MyFramework and it works perfectly, but of course I cannot use MyView.

What am I doing wrong ?

2 Answers

Answers 1

If you use use_frameworks! your pod itself will become a framework. Therefore you should #import MyPod instead of #import MyFramework and then use MyView.

Review also public_header_files in case you need it.

Answers 2

Since the project's pods are now a framework, you could try importing it as a module using @importMyFramework.

However, if that doesn't work, then try backing up your project and then running pod deintegrate && pod install. Also, this question is very similar, and some of its comments and answers may be helpful.

Read More

Thursday, August 11, 2016

iOS : Could not build module <framework-name>

Leave a Comment

I've got Library from another team. I'm trying to use library in our project and while do so getting an error Could not build module 'Common Library' (name of framework)

Screenshot 1

Below are solutions that I worked on but didn't helped :

1. Delete Derived data content. Clean and Build.  2. Framework is added in 'Link binary with libraries' of Build phases.  3. While adding framework checkmarked : Target and Copy content to folder. 

Even I tried this stackoverflow-link but didn't got any break-through!

screenshot 2

screenshot 3

The only thing that worked was deleting Objective-C bridging header path in Swift compiler - code generation section of build settings in Project.

However, thereafter I'm not able to get Common interface to create instance (i.e. Common dosen't appears in drop-down list)

Any other fix?

2 Answers

Answers 1

Check whether the framework you are integrating is supporting your project architecture.

To see the framework supported architecture, use Terminal and navigate to Framework folder.

use, "lipo -info myFramework.framework/MyFramework"

And, if you want to use the framework files in your project, check whether the files are available in Framework/Headers Folder.

Getting this error :

Screenshot

Try, "file myFramework.framework/MyFramework" in Terminal

Answers 2

I found the same issue of framework when i try to add framework then i can't add framework and got error like same as you got.

Then i remove and reinstall X-Code and its working fine. so please try this.

Read More

Sunday, April 10, 2016

Embed a framework without module in a Pod

Leave a Comment

I'm using a 3rd party library provided as a framework : Library.framework. Apparently, it can only be used in my Swift project via the Bridging Header by doing #import <Library/Library.h>. Which is fine in most cases.

However, I'm currently developing a Pod in which I want to use Library.framework. This means that I cannot rely on the Bridging Header.

I tried to link the Library.framework in my Pod target (see General > Linked Frameworks and Libraries) but then, once the Pod is installed in my app, Xcode says the Pod cannot compile because some files in Library are not found.

What would be the best strategy to adopt here ?

2 Answers

Answers 1

I think I made it.

The trick was to add the .h files in both source_files and public_header_files in the Pod.podspec.

Like this :

s.source_files = 'Library.framework/Headers/*.h' s.public_header_files = 'Library.framework/Headers/*.h' 

This way, all the header files appear in the Pod-umbrella.h and can now be used in my app.

Answers 2

In your pod project I assume you have a file named [PodName].h, it will look similar to the file below. You could try to add the header in this file.

// //  PodName.h //  PodName // //  Created by John Doe on 06.04.2016. //  Copyright © 2016 John Doe Inc. All rights reserved. //  #import <UIKit/UIKit.h>  //! Project version number for PodName. FOUNDATION_EXPORT double PodNameVersionNumber;  //! Project version string for PodName. FOUNDATION_EXPORT const unsigned char PodNameVersionString[];  // In this header, you should import all the public headers of your framework using statements like #import <PodName/PublicHeader.h>  #import <Library/Library.h> // Add framework header here. 
Read More

Monday, March 7, 2016

Using Alamofire with an iOS 8.0 Embedded Framework

Leave a Comment

I am trying to use Alamofire within a custom framework that I am creating. I created my custom framework project, added the Podfile, installed Alamofire. I then created a sample project to test out my custom framework.

The sample project is compiling fine with my custom framework import, that is until I started making Alamofire calls within my framework. Now Xcode is complaining about "Missing require module 'Alamofire'" within my sample project. And if I add "import Alamofire" to the swift file, Xcode now complains about "No such module 'Alamofire'"

Is if possible to use a swift framework such as Alamofire within a custom framework, and does the project using my custom framework need to import the Alamofire framework as well?

2 Answers

Answers 1

Yes, it is possible to use Alamofire within your custom framework, but you need to also include Alamofire in the podfile of your sample project (the project that uses your framework). Your podfile should look like this:

platform :ios, '8.0' use_frameworks!  target 'MyApp' do #   pod 'MyFramework'  Include MyFramework if it is a cocoadpod    pod 'Alamofire' end 

The error "Missing required module 'Alamofire'" happens because your framework doesn't actually include Alamofire when you use it in some other project, and you cannot import Alamofire in your sample project for the same reason.

If you plan to make your project a Pod you can include the following line in your podspec:

s.dependency "Alamofire", "~> 3.1.5" 

Including Alamofire as a dependency in the podspec instructs cocoapods to also include it when your framework is installed.

Hope it helps.

Answers 2

Not 100% sure if this is your issue of not, but for swift stuff you have to use the use_frameworks! directive in your Podfile. Could that be the issue?

I ran into this once and found answer from https://www.raywenderlich.com/97014/use-cocoapods-with-swift

Read More