Trying to install Purelayout using cocoa pods in swift project - ios

I am currently having problems installing Pure Layout using Cocoa Pods. Ive managed to install it fine in a blank project with no problems. But when installing into my project i keep getting the following error:
ld: framework not found PureLayout
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Ive had a search through stack overflow for any possible solutions and have tried adding the framework search path to the target, trying to delete cocoa pods and do a fresh install onto the project.
Initially before adding 'PureLayout' to the pod file i got a similar error:
ld: framework not found Pods
To resolve this i removed the red pod framework file from the linked library and framework folder. Which then built fine.
Thank you in advance for anyone who helps me solve this.
Below is my Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.1'
# Uncomment this line if you're using Swift
use_frameworks!
target '****' do
pod 'Google/Analytics'
pod 'Fabric'
pod 'Crashlytics'
pod 'PureLayout'
end
target '****Tests' do
end

Managed to solve this issue by:
-Select Pods Project
-Build Settings
-Set BaseSDK to iOS SDK (since pod install clears it)
-Set Build Valid Architecture Only to NO.
Following this process the project now builds. I was able to import Pure Layout into my Bridging Header and access the pure layout functions in any of my view controller classes.

Related

ld: framework not found FileProvider for architecture x86_64

I have already raised this kind query, still I did not get any helpful answers, so that, I am posting this again.
I am installing firebase, googlesigin, twitterkit and fabric to my swift application by Cocoapods.
If I installed only Fabric I am able to compile and run the application. But, If I tried to install GoogleSignIn and TwitterKit, Fabric, its installing successfully, but, not able to run, getting compiler error of following.
ld: framework not found FileProvider for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And my podfile is like following.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'pod installation' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Fabric'
pod 'TwitterKit'
pod 'Firebase/Database'
pod 'Fabric'
pod 'GoogleSignIn'
# Pods for sample pod
# Pods for pod installation
target 'pod installationTests' do
inherit! :search_paths
# Pods for testing
end
end
Attached screenshot, any help from anyone. I am trying to fix this from two days and Really thanks for who helping this fix.
Note : I am using Xcode 8.3.2 and I don't have any real device with me now, and I am not using any FileProvider framework in my application.
Perhaps your pods using FileProvider-framework.
FileProvider-framework is available from iOS11.0 + with Xcode 9 hence You should upgrade with Xcode 9 to avail this framework.

Cocoapods project settings issues

I seem to have a issue with my project settings, in Xcode 8. The issue is as follows:
When adding a new Pod - lets say, Pod Firebase - the install works, and adds the necessary files to my project. I can then, do #Import Firebase
All is fine, up to this point. However, as soon as I make a reference to the Firebase API example: [FirApp configure]; - all is still fine - autocomplete on Xcode works as expected and no issues. However, when building I then get a compile time issue which states:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRAppIndexing", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The only way I am able to solve this - is by manually adding the _FIRAppIndexing.framework in my projects, Build settings, under Link Libraries with Libraries
To do that, I just drag and drop the frame work from the project navigator to the correct section under link libraries.
This works sometimes; as with other parts of the Firebase SDK, I get runtime crashes.
So, to try get to the root cause, I created a brand new test project, installed the Pods using Pod install - I however did not have to add the framework manually to Libraries - its actually not even listed there.
Everything in the test project worked just fine, at compile and run time.
Which leads me to believe its something in my project settings that's causing this.
Things I have tried
Removed cocoapods completely with pod deintegrate and removed all
other traces of it. Then did a clean build. Then Pod install
Added -objc to linker flag
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Crashlytics'
pod 'AsyncDisplayKit', '>= 2.0'
pod 'Firebase'
pod 'Firebase/Messaging'
pod 'FBSDKCoreKit'
pod "HockeySDK", :subspecs => ['AllFeaturesLib']
pod 'Fabric'
pod 'FirebaseAppIndexing'
pod 'AFNetworking', '~> 3.0'
pod '1PasswordExtension', '~> 1.8.4'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
end
GitHub example project
https://github.com/TanderZA/MyApp
I duplicated my current project - and removed all files. Problem still exists. You will see the project won't compile due to linker errors, with references to the Firebase AP.
By manually adding the frameworks to Link Libraries with Libraries, you will see that it should compile. But that is not how it should work. The current project has an issue with infoPlist.strings that I did not solve. But the project is in the state to demonstrate the issue.
I have checked the project, it seems you have messed up with schemes.
Create a new scheme properly then install the pods again and as the project is in Obj-C you don't need to enable frameworks in the podfile.
So comment like # use_frameworks!
Also update the pods using pod update
Then select the new scheme and build the project in it.
Let me know if you are not able to do it.
It is a xcode bug by the way
But try this :
Upgrade to latest version of xcode and Pods
Remove all architectures in your project
Clean your project
Add arcitectures from start.
This should resolve the issue.
Have you tried to use frameworks?
# platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
I am not sure though but I think what you need is pod 'Firebase/Core'. not pod 'Firebase'.
This link have the list of the Firebase framework that can be used.
And, in the video on the top of the page it says something about there is no single pod that can be installed and you need to set each one of them on the podfile depending on the features you want.
My guess they mislead us in some places where they had pod 'Firebase'. I dont think that they meant that it should do the work.
som try the following:
# Pods for MyApp
pod 'Firebase/Core'
pod 'Firebase/Messaging'
.
.
I know that you said that you had it work on another new project.

ld: framework not found FirebaseAnalytics after upgrading to Xcode 8

I know there are many related questions about "framework not found FirebaseAnalytics". I have spent time on these related questions and tried the solutions suggested by others but in vain. So I have to ask again there and hope anyone can help me.
My problem is that i'm able to use Firebase SDK(IOS) installing by CocoaPods since Xcode 7. However once I upgraded to Xcode 8.1, I cannot compile my project anymore. It keeps showing the error:
ld: framework not found FirebaseAnalytics clang: error: linker command
failed with exit code 1 (use -v to see invocation)
Only when I remove the firebase in the pods can I build the project successfully. Also, it comes to my nightmare that i'm unable to install google analytic SDK because the same error message comes again.I think it is because google now combines the firebase in their SDK.
Here is what I tried from the results I found from other posts in Stack-overflow.
Open the workspace rather than xcode project
Adding $(inherited) in framework search path
Remove the CocoaPods project from xcode and re-install again
Update the Xcode's CocoaPods project
Adding use use_frameworks!, this will create error of #import"XXX" and #import not found
Delete red framework in Linker Binary with Libraries
My Xcode version is Version 8.1
Here is my pod setting:
platform :ios, '8.1'
def testing_pods
pod 'AFNetworking', '~> 3.0'
pod 'AWSMobileAnalytics', '~> 2.4.1'
pod 'AWSSNS', '~> 2.4.1'
pod 'Google/Analytics'
pod 'Firebase/Core'
end
target 'project' do
testing_pods
target 'project_test' do
inherit! :search_paths
end
end
target 'project_Dev' do
testing_pods
end
Hope someone can help me otherwise I have to migrate this old project to a new one.

I'm getting framework not found <library> when installing with cocoapods

I installed Google Sign In via cocoapods, but when I tried to compile got this error
ld: framework not found GoogleAppUtilities
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Podfile is this:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'Project_name' do
pod 'PayPal-iOS-SDK'
pod 'Google/SignIn'
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Project_name
target 'Project_nameTests' do
inherit! :search_paths
# Pods for testing
end
target 'Project_nameUITests' do
inherit! :search_paths
# Pods for testing
end
end
I installed the PayPal library first without problem.
I'm using .xcworkspace
Tried cleaning and building again, using $pod deintegrate
clean the project and $pod init again and nothing seems to change.
In Xcode, look in the Pods project for a file named GoogleAppUtilities.framework. It's probably under the Pods/Products folder. You need to add a reference to this file (GoogleAppUtilities.framework) in your main project. In you main app project file go to the build settings tab and look at the list named "Link Binary with Libraries"...you need to add a reference here to the GoogleAppUtilities.framework file.
Just adding your comment as the solution: it worked for mee too:
Solved, I thank you. Your answer did not solve the issue, but It gave
me an idea. I did that and in Build
Settings->SearchPaths->FrameworkSearchPaths I added the framework in
Debug and Release.

ld: Framework not found

Trying to install Alamofire via Cocoapods. This is a brand new app with zero configuration. I've pod install the app and opened the project via it's workspace. Receiving following error using XCode 7.1.
ld: framework not found Alamofire
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Podfile
# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'Bitcoin Watcher' do
pod 'Alamofire', '~> 3.1'
end
target 'Bitcoin WatcherTests' do
end
target 'Bitcoin WatcherUITests' do
end
Pods.framework is found in my Linked Frameworks and Libraries. This is absolutely frustrating as I've tried numerous solutions but none work. Cocoapods version is 0.39.
you should remember that when you install a new version of Xcode, before pod updating/installing, you should first do sudo gem install cocoapods. This will update all the gems which might have beenm deleted due to updating of Xcode.
Then remember next step is there should not be any fiels in target space relating to your dependencies, mentioned in pod. This will confuse your Xcode about the relevant files to use for using dependency.
Hence, ensure that dependencies files are mentioned in the pods folder only.
Next remember that in the linker path settings, you should use first $inherited for specifying the path of libraries.
This step should be done before installing any dependency.
Lastly cmd+ Shift +k -> Clean the project should be done before using pod Install from terminal.
Jason in your case xcode is unable to link framework, so do mentioned in above steps.
Hope it answer all your questions
If you are building a project for tvOS, you should specify
platform :tvOS, '9.0'
instead. I don't know if this will solve all of the problems, but it will get you closer for sure.
If you are using Cocoapods, check the version and update, clean and run the app
sudo gem install -n /usr/local/bin cocoapods
pod install
pod update

Resources