Xcode9 beta - Error adding openssl & library not found for -lcrypto - ios

I am trying to add open SSL universal via cocoapods, it's installing it but on terminal, I am getting this message
The CustomerApp [Debug] target overrides the LIBRARY_SEARCH_PATHS
build setting defined in Pods/Target Support
Files/Pods-CustomerApp/Pods-CustomerApp.debug.xcconfig. This can lead
to problems with the CocoaPods installation
- Use the $(inherited) flag, or
- Remove the build settings from the target
another problem is in XCode (9 beta) build failed with this error
library not found for -lcrypto..
I am really dying because of this, have tried everything possible but no success I tried manually adding OpenSSL by downloading from site and setting the path in build settings by doing that it doesn't show error but in my swift file when import OpenSSL it says no such module.
please help me!

I think it is looking for libcrypto.a library, can you search through your project see if it exists. When you download the OpenSSL library, it should have the library along with a bundle of header files.

Related

pjsua2 on ios Library not found for -lssl

Getting pjsip user agent sample project working
I have compiled the libraries for pjsip here:
pjsip ios
I have gotten android to work and I am trying to get the xcode project running for the user agent. I have compiled it against openssl. I added the user agent library and the openssl libraries to the library folder. Once done, I have one error left that I cannot seem to solve:
Showing All Errors Only
Library not found for -lssl
I am getting this even when I do not use or build against the openssl options
my openssl libs are: libcrypto.a and libssl.a once those are added, my error count goes from 111 to one. This is my first ios project so I was wondering if I missed a step adding the references.
has nothing to do with whether ssl is enabled. Some of the libraries use openssl so the project needed header and library paths. Copied the OpenSSL output I already had to the project, and it built fine
Found the answer here: Wai Ha Lee answered it.
add open ssl

Xcode 9.1 - Missing required architecture x86_64 in file

I am using the library SwipeCellKit and having problems since the update to Xcode 9.1. I've recompiled the library with Xcode 9.1 and reimported the .framework in my Project. But I still can't use the classes from the library. I am getting this warning:
ld: warning: ignoring file /Users/.../Frameworks/SwipeCellKit/SwipeCellKit.framework/SwipeCellKit, missing required architecture x86_64 in file /Users/.../Frameworks/SwipeCellKit/SwipeCellKit.framework/SwipeCellKit (2 slices)
I've tried what is suggested here and set Build Active Architecture Only to No when building the library. But it doesn't help. I've also cleaned the build folder many times, which doesn't solve the problem either.
Please always use Cocoapods to install libraries for your project, it will automatically manage all dependencies.
To setup you project for cocoapods please follow steps mentioned in http://cocoapods.org/ it will make your life easier believe me.
Once you setup cocoapods successfully,
then add
pod 'SwipeCellKit'
to your Podfile
and run terminal and goto your root project directory using cd ....
then type pod install
then open your root project folder using finder
and open YOUR_PROJECT_NAME.xcworkspace file and the issue will be gone gone,
let me know if you encounter any issue installing pods.
Thanks

Embed OpenSSL module in Swift framework so its not needed when importing into application [duplicate]

I have installed OpenSSL in xcode for receipt validation, but it doesn't work.
I download openssl.xcodeproj and openssl-1.0.1f. I extract openssl-1.0.1f and add openssl.xcodeproj to my project.
I edit the Header Search Path to :
/Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl
I added libcrypto.a in Target Dependencies under Build Phases
and added libcrypto.a in Link Binary With Libraries
as was described in http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/.
But when I build project it stops with error :
clang: error: no such file or directory: '/Users/ .... -bmgslnakszsfovecplbzoslykrxo/Build/Products/Debug-iphoneos/libcrypto.a'
Why ?
OK, how to build and install it....
It might be easier to use a pre-built version of OpenSSL for iOS. You can find one at this Github account. The OpenSSL from that Github are multi-arch. They have ARMv7, ARMv7s, ARM64, and i386. That means they work with devices and simulators.
Download either OpenSSL 1.0.1e or 1.0.1f. Install it in a location like /usr/local/ssl/ios.
Then, add the headers to your Xcode project. They are located in /usr/local/ssl/ios/include:
Finally, add the multi-arch libs (libcrypto.a and libssl.a) to your Xcode project. They are located in /usr/local/ssl/ios/lib:
You need to add the library as a Framework. See this question: how to add an existing framework in Xcode 5.
Its OK to add the OpenSSL libraries under Frameworks. Its how things are done under Apple/Xcode.
I use the Absolute Path like in the image below because Crypto++, OpenSSL, etc are installed in /usr/local. The image below is a screen capture I have handy of Crypto++, and not OpenSSL's libcrypto.a or libssl.a. But the same applies to all libraries.

Static library and cocoapods with Xcode 6.1.1 - ld: library not found Error

Not sure it is related to Xcode 6.1.1 or Cocoapods 0.35.0.
I have generated new static iOS library with Xcode 6.1.1.
SUCCESS (without cocoapods)
Generate simulator and Device library
Lipo to both and generate FAT MyLib.a static final lib
Create new View Application project. (I haven't changed any default setting. e.g. Base SDK, Valid Architecture.)
Add MyLib.a and necessary header files to application project manually.
Build the app project and IT WORKS FINE !! NO ERROR NO WARNING.
ERROR
Upload same MyLib.a & headers (generated above) to HTTP direct download server(kind of artifact server).
Generate specs & podfile.
Remove all dependency (lib and header) from app project which i have done manually earlier.
Add pod file and local specs
"Pod install" command pull out MyLib.a and header properly in /Pods folder.
But while building the app project gives me
Ld Build/Products/Debug-iphonesimulator/LibTest.app/LibTest normal x86_64
cd /Users/admin/Cocoapods/Project/Library/TestProject/LibTest
export IPHONEOS_DEPLOYMENT_TARGET=8.1
ld: library not found for -lMyLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When i fire "lipo" command on MyLib.a
Architectures in the fat file: /Users/admin/Cocoapods/Project/Library/Libs/Final/MyLib.a are: armv7 armv7s i386 x86_64 arm64
Its not really architecture issue otherwise it should get failed in my first attempt which doesn't have cocoapods. Cocoapods does some build configuration changes and that creates this issue.
Help me to resolve this issue.
After spending 2 days to figure out the exact issue, i found very silly fix. Its basically issue with static library naming convention issue.
If you have static library in artifact/media http server and wanted to integrate with Cococapods, make sure library name should be lib(your name).a along with headers.
In my case i have kept MyLib and it got dowloaded currently while "pod install" but during app building it was failing.
After renaming to libMyLib.a, every thing works for me. :)
Very easy to apply yet difficult to find such solution]
Not sure whether cocoapods has documented this in there any guide or not.

library not found for lcrypto

I'm trying to build the iOS AllJoyn project, but I'm having trouble with the OpenSSL integration.
I've been looking at these directions: https://allseenalliance.org/docs-and-downloads/documentation/configuring-build-environment-ios-and-osx#unique_16
I've followed the directions all the way up to Xcode IDE Build, but now I'm getting an error that says: "library not found for lcrypto".
Looking online it looks like there might be something to do with the Makefile, but I'm not really sure what lcrypto is and what library I'm supposed to be referencing.
EDIT
I noticed that it says it is a Shell Script Invocation Error
Also here is the trace:
ld: warning: directory not found for option '-L/PATH/alljoyn/alljoyn/common/crypto/openssl/build/Debug-iphoneos'
ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/darwin/arm/iphoneos/debug/obj/test/bbcclient] Error 1
scons: building terminated because of errors.
Command /usr/local/bin/scons failed with exit code 2
In order to successfully use the AllJoyn SDK you need to have a compiled version of the openssl library available (i.e. libcrypto.a).
The details to build the openssl library can be found in the README-INSTALLING.txt file under /alljoyn_objc in the SDK, I have copied the relevant instructions below. Once you have created the openssl library you need to place it in a directory accessible to your project (in your case "/PATH/alljoyn/alljoyn/common/crypto/openssl/build/Debug-iphoneos").
Most of this information is contained in the AllJoyn Programming Guide for Objective-C
Relevant text from the README-INSTALLING.txt file:
OpenSSL is required for iOS development and is available at the following web
address: www.openssl.org
AllJoyn has been tested with version 1.0.1 of OpenSSL.
Download the Xcode project that can be used to build OpenSSL for iOS from GitHub,
at the following web address: https://github.com/sqlcipher/openssl-xcode/
Installation
Copy the OpenSSL source into a separate folder on your development system, not
under the AllJoyn SDK.
Navigate to the OpenSSL source top folder in Finder, and copy the openssl.xcodeproj
folder you downloaded from GitHub into this folder.
Open the openssl.xcodeproj in Xcode.
In Xcode, build the crypto target (libssl.a and libcrypto.a) for each
combination of configuration (debug|release) and platform (iphoneos|iphonesimulator) that you
need for your iOS project by selecting Product->Build For->(your desired configuration).

Resources