How does this Xcode project on Github link its static files? - ios

I found this project live555-on-ios which appear to be using precompiled .a files (libliveMedia.a, libBasicUsageEnvironment.a, etc). But I could not figure out how it gets linked. I would expect they are included in Target -> Build Phases -> Link Binary with Libraries in Xcode. But they aren't there. Maybe I haven't kept up with the ways libraries can be linked. How do they get linked?

Please add all required Link Binaries to Other Linker Flags in Target -> Build Settings.
Use below code in this project to link required Binaries.
FOR
libUsageEnvironment.a : "$(SRCROOT)/live555/UsageEnvironment/libUsageEnvironment.a"
libliveMedia.a: "$(SRCROOT)/live555/liveMedia/libliveMedia.a"
libgroupsock.a: "$(SRCROOT)/live555/groupsock/libgroupsock.a"
libBasicUsageEnvironment.a: "$(SRCROOT)/live555/BasicUsageEnvironment/libBasicUsageEnvironment.a"
Hope your code will work as per your expectation. Its working ok for me.

Related

Problem compiling React native project on ios

I get errors of not finding the React/reactLog.h file and more files from various react native libraries.
Have tried cocapods and it says it is installing, but it seems as if it's not installed in any libraries.
The error is:
'FBSDKSharekit/FBSDKSharekit.h' file not found
Well, in any case you have to follow the instructions again from this link and double check everything:
https://github.com/facebook/react-native-fbsdk
However, in my opinion this error occurs if you don't download and put the FacebookSDK in your document folder and drag and drop it into your project. So check if you have downloaded it and put it there please. After Putting it there, you should go in your Xcode project in the Library -> RCTFBSDK.xcodeproj path and drag and drop FBSDKSharekit file from your facebook SDK folder(In your document folder) into the framework folder. You have to do the same thing with FBSDKCore and FBSDKLogin.
In addition you should check these two points:
1- FBSDK[Core, Login, Share]Kit.framework show up in the Link Binary with Libraries section of your build target's Build Phases.
2- Make sure that ~/Documents/FacebookSDK is in the Framework Search Path of your build target's Build Settings.
Then try to clean and compile the project. I hope it helps you.

iOS : Could not build module <framework-name>

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)
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!
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)
Below is framework structure.
Any other fix?
you can try delete DerivedData dir.
where is DerivedData?(xcode 8)
go to File > workspace Settings, you'll see DerivedData path.
DerivedData path in xcode 8
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 :
Try, "file myFramework.framework/MyFramework" in Terminal
I think you does not need to compile CommonLibrary.framework again. So you can try to remove it from Embedded Binaries list. And make sure the path of CommonLibrary.framework is in your Framework Search Paths.
I also had this problem:
1. My 'GoodLuck' framework had two headers: GoodLuck.h and GLAdder.h
2. Project which import this framework couldn't compile
Solution:
Import GLAdder.h in GoodLuck.h, rebuild the framework. It works.
I also had this problem, due to a typo in my GCC_PREPROCESSOR_DEFINITIONS, which therefore invalidated all of my code.
First helpful warning was multiple "Macro Name must be an identifier" followed by multiple "Could not build module" messages.
As this question do not have answer yet, so adding my answer here it may help in future for some another developer.
I know due to privacy you can not disclose the details.
I have used same library and faced same issue so just did did this two things it is working fine.
In General -> Frameworks,Libraries -> CommonLibrary.framework just select that and choose -> Embed Without Signing.
Build Settings -> Search for "workspace" -> Validate workspace -> set it NO
That's it you are done.

Error compiling Redis library into iOS Project ("_OBJC_CLASS_$_ObjCHiredis", referenced from:)

I am trying to integrate the simulator static library of Redis into my iOS project and have done the following things.
drag and drop the static library into my project folder
Add header search path in the build settings
Check whether the static library is added into the build phases in settings.
Set the header search path
Set the other linker flags setting to "-all_load"
I am not sure where i have gone wrong but am geting the following error while compiling it.
Any help in this regard is greatly appreciated.
I was also getting such errors and figured out that adding .m files in "Build Phase" -> "Compile Sources" for the target fixed my problem.
Actually this happens if we miss to tick the Target Name in "Add to targets" name while adding any new library to it. (For your case, after drag and drop you might have seen a dialog box with options to copy items if needed, Add to target etc.)
Finally build and run. Hope this solves your problem!
The static library which you are dragging is not build for i386 architecture(simulator), try running your app on device, or build for device. Basically your app with the corresponding library will work on all such architectures for which it is built(armv7, armv64).
If you want to use the library and build your app on the simulator you need the static library which is also built for i386. And this could be provided by the developer of the static library.
Basically a fat(static library) file is created using static libraries for i386 and armv7(any required architectures) and shipped with the SDK of the static library which works on simulator as well as device.
The fat file is created by executing a lipo command on individual architecture static libraries.

Balanced Payments tutorial in iOS [duplicate]

I am trying to do the payment using https://www.balancedpayments.com/ . They have their iPhone library for this https://github.com/balanced/balanced-ios . The problem is that there is not enough documentation on how the Balanced.framework has to be added in the XCode 4.5 project?
Download the Balanced framework.
Add Balanced.framework to your project and to Build Phases -> Link Binary With Libraries.
Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries.
Usage:
#import <Balanced/Balanced.h>
Balanced *balanced = [[Balanced alloc] initWithMarketplaceURI:#"/v1/marketplaces/TEST-MP2autgNHAZxRWZs76RriOze"];
BPCard *card = [[BPCard alloc] initWithNumber:#"4242424242424242" expirationMonth:8 expirationYear:2025 securityCode:#"123"];
If you need more help, look at the example project they have attached...
You Just Need to add those Balanced- Classes as a static library, It will work out.
Add a Static Library to your Project.
Now add those balanced classes to your static Library.
Goto YourProject->Target->BuildPhases->LinkWithBinaryLibraries
Here add the StaticLibrary.
Hope this will help you.
Follow this issue on Github. The lack of linking Balanced.framework is related to Xcode templates. The fix is documented in the project's "Contributing" section. You need to build it.
The balanced-ios project has changed quite a bit since this question was asked. It now creates a static library instead of a framework. This change was made for the reasons described in balanced-ios Project Architecture.
To integrate balanced-ios into iOS projects, do the following:
Download the latest pre-built release zip from https://github.com/balanced/balanced-ios/releases
Copy balanced.a to your project
Add balanced.a to Build Phases -> Link Binary With Libraries
Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries
Copy includes/balanced to your project's include folder (or create an include folder and copy includes/balanced to it) includes is automatically included in header search paths. Drag includes to your project so you can see the files from there. If you copy the include files to a location other than includes you'll probably need to add the path to User Header Search Paths in your project settings
Code usage examples can be found in the README at https://github.com/balanced/balanced-ios

Linking Static Library to iPhone App

I'm trying to link 2 static libraries with my iPhone app. When I compile a separate, identical file with g++ that links against the 2 libraries like this:
c++ main.cpp -o main -lcln -lginac
it works fine.
In my app I went to build phases -> link binary with libraries and added libginac.a and libcln.a. However, when I compile my app at the line #include ginac/ginac.h I get the error: ginac/ginac.h: No such file or directory.
What am I doing wrong?
Maybe you mix up "header search path" with "links binary libraries".
Adding the .a file to your project files does not mean, that also the headers are available.
You should check the "header search path" within your "build settings" and make sure, the path to "ginac" is set there.
This question:
Compile, Build or Archive problems with Xcode 4 (and dependancies)
And this answer should help you solve the issue.
In addition:
Xcode 4 can't locate public header files from static library dependancy

Resources