I've included an iOS framework in the xcode project for the React Native module library I'm creating. Everything compiles fine when I build the ios project in the RN library itself, but once I npm install the library into my main RN project, running react-native link <project-name>, and then build in xcode, the included framework headers are not found.
I checked the normal build settings (Header, Framework, and Library search paths) and they all have $(inherited) listed.
Repo for the react native library that is WIP https://github.com/bsy/react-native-pollfish
Download SDK file from here . May be owner removes the SDK from github.
Please add this line in your package.json file.
"rnpm": {
"ios": {
"sourceDir": "./ios"
}
}
Also, unable to install your plugin with "npm install".
The solution to this issue was to make sure that both your Xcode subproject and your main Xcode project both point to a relative path to the SDK.
Steps to take:
Open your application's Xcode project.
If you don't have a Frameworks group in your project, create one.
Open ~/Documents/PollfishSDK using Finder.
Drag the pollfish.framework file into the Frameworks group of Xcode's Project Navigator. In the displayed dialog, choose Create groups for any added folders and deselect Copy items into destination group's folder. This references the SDK where you installed it rather than copying the SDK into your app.
For 3rd party framework set the framework search path in the library project-
$(SRCROOT)/../../../ios/Pods/3rd_party_framework_folder_name
Related
I am trying to include ios sdk framework in my react-native module library. I turned always embed swift standard library to Yes in build setting. Everything compiles fine.
Then I include the node module in an app using npm i react-native-my-framework, open sampleapp.xcworkspace and build in XCode, I get an error MyFramework/MyFramework-Swift.h not found. I tried following permutation combinations:
Put MyFramework to Frameworks, Library and Embedded Contents. and tried some other combination of build settings.
Set the framework search path in the library project - $(PROJECT_DIR)/../node_modules/react-native-my-framework/ios/
I manually included libMyFramework.a to Libraries group.
But I am still facing the same issue. What am I missing here?
Also, MyFramework is not on Cocoa pods
Update:
Now MyFramework is available on Cocoapods
I'm doing a flutter plugin for stream video by using RTSP protocol. I had no problem develop it for Android, but in iOS things are more complex. I have to use an external library (SGPlayer) for getting the player work. I also downloaded the demo that uses this library and seems to work. This library is NOT on Cocoapods and I need to import it directly into the plugin project from my file system. the downloaded and compiled file structure of the plugin that I would like to use looks like this:
My problem is adding the ".framework" extension file correctly to the iOS project in a way that I can use it to develop the flutter plugin (iOS part).
UPDATE:
I built the project with the framework by using instructions at this link: https://github.com/flutter/flutter/issues/17978
The problem now is that while compiling the framework it change the umbrella header because, I think, it's not using the framework module.modulemap but another one. The result is that is importing just some header and implementations, and not all.
1.Place myFramework.framework to iOS plugin folder /ios ex: myPlugin/ios
2.Update iOS plugin file: myPlugin/ios/myPlugin.podspec
Adding the below line at the bottom of the file, above 'end'
s.vendored_frameworks = 'myFramework.framework'
In Terminal : cd to myPlugin/example/ios
run command
pod install
or
pod update
Now we can find the iOS plugin code by open iOS project (example/ios/Runner.xcworkspace) in XCode and go to
#Lorenzo you can pack your plugin and make private CocoaPod or Carthage repo.
Here is a good article howtos
Im building a IOS app that uses a third-party library.
The library project is inherited from another developer that im unable to ask anything.
It is configured to use CocoaPods to manage dependencies, it has a lot of them.
When i run "pod install" it downloads all of them and creates the workspace.
In the workspace i have set the app target as dependent from the framework project product
Then i try to build it and it says it cannot find one of the dependencies of the framework project (it is on the podfile)
Then i found the framework project is missing "[CP] Embed Pods Frameworks" in build phases (the app project has it)
Also the "Pods_[targetName].framework" is shown in red (even when it indeed is in the build products folder, the path is correct)
I found this issue that seems to be exactly my problem but im unable to see if it has been fixed or not and what could i do to workaround this.
Same effect for me, my issue was the s.source_files in the podspec did not reference a location with actual files after a refactor.
I have a react native project that runs successfully on simulator but not on device.
I have run the project on the same device before, but not since I've incorporated cocoapods, though none of the above library are in cocoapods. I'm building in xcworkspace rather than a project file, not sure if that is it.
Not sure what this could be... Any suggestions appreciated!
Usually these type of errors appear when the libraries are not linked with the project.
The libraries might have been unlinked after adding cocoapods. Try running npm install and then react-native link to link all the libraries or run react-native link <library-name> to link the specific library in the terminal from your project root directory.
Has anyone downloaded the demo iOS version of EchoPrint? It's an audio fingerprinting open source software.
I just downloaded it but it appears to missing framework... any place to get a functioning version?
Follow the steps to get it the framework running
Download latest version of boost . The download link for latest 1.51.0 for boost library
Extract the boost_1_51_0.tar.gz file.
Download the project for generation of libechoprint-codegen-ios.a famework from here
Open the project and set the Header Search Path as the path of the extracted boost folder. e.g. in my case the below is the path
/Users/$(USER)/Downloads/boost_1_51_0/boost_1_51_0
Open the echoprint-codegen-ios.xcconfig file and add the same path in the HEADER_SEARCH_PATHS
Now clean and build the project would give you libechoprint-codegen-ios.a under Products folder
Now download the Echoprint iOS Sample
Building this project would give you Errors as the files of ASIHTTP folder and the libechoprint-codegen-ios.a framework is missing are not added to the xcode project but are physically present in the project Folder.
Delete this folder from the project and drag-drop the physical folder to the xcode project. Also delete and add only the libechoprint-codegen-ios.a framework to this project from the previously compiled project.
Now you are ready with an error-free code.
Update for people who are still interested in this and are using XCode 5 + iOS 7 + LLVM 5.0.
I have forked the sample repo, upgraded it to XCode 5+ iOS 7 and modified it to automatically build in the echoprint-codegen dependency as a sub-project: https://github.com/rexstjohn/echoprint-ios-sample.
The above instructions will no longer work for the latest XCode + iOS.