ld: Framework not found - ios

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

Related

Install native iOS pod in flutter

I am facing an error while making a flutter plugin on the iOS side while using pods. The pods are installed successfully then also I am able to import them in the file.
The pod in my case which I am trying to use is Freshchat iOS SDK
Steps I have followed to install the pod
Start a new Flutter plugin project.
In .podspec file add s.dependency 'FreshchatSDK'
Run pod install in example/ios folder.
I got an error
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/nimish/FlutterProjects/freshchat_flutter/freshchat_flutter/example/ios/Pods/FreshchatSDK/FreshchatSDK/libFDFreshchatSDK.a)
I removed use_frameworks! from podfile following this comment .
I ran pod install again and the pods were successfully installed and Pods folder was created which had FreshchatSDK folder in it.
Now I need to have use_frameworks! in my project because other plugins are not compiling because of this.
I added s.static_framework = true in .podspec and use_frameworks! in podfile. Now pod install ran successfully,
After I added the import #import "FreshchatSDK.h" in my Plugin.h file I got the error
error: include of non-modular header inside framework module
I tried this answer but was not able to resolve it.
Please help me resolve this. I'll be respectful of your time.
There is another flutter plugin available here but it has many issues and one unhandled case is making my iOS app crash so I want to make it my own.
There may be problems in the PodFile due to unmatched Targets.
When this happens to me, I used these simple steps.
Delete Podfile
Open Terminal at the specific file
Pod init
Open Podfile and adds Dependencies
Pod install

How to create app store app update notification mechanism using Swift 4.2?

My scenario, I am trying to Implement app update notification for my application. I tried Siren Pod but It is showing no module found. Please provide me a solution or alternative ideas.
Siren Pod
Siren Link
Here, i am getting No Module Found after pod installation also.
Import Siren // No module found
Did you open your .xcworkspace or .xcodeproj? This error message is one that you’d get if you accidentally opened the .xcodeproj.
Following the Siren installation instructions for cocoapods, you’d do something like the following in your “Terminal” window. Specifically, if you hadn’t created the Podfile yet:
$ cd MyApp
$ pod init
And you can edit your Podfile, something like:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Siren'
end
Then you can do can install your Cocoapods from the “Terminal”:
$ pod install
Analyzing dependencies
Downloading dependencies
Installing Siren (4.2.1)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Note the warning:
Please close any current Xcode sessions and use MyApp.xcworkspace for this project from now on.
And now open the workspace, not the .xcodeproj:
$ open MyApp.xcworkspace

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.

Trying to install Purelayout using cocoa pods in swift project

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.

Cannot compile Cocoapods with XCode/Obj-C – "Pods-prefix.pch.dia: No such file or directory"

I am using XCode 4.5.1 and iOS 6.0 base SDK.
Here is the error I am receiving:
i686-apple-darwin11-llvm-gcc-4.2: /Users/fahim/Library/Developer/Xcode/DerivedData/Currenthiphop-emodxxwwaiojlcboaxuodksuwuww/Build/Intermediates/PrecompiledHeaders/Pods-prefix-evibdktwbatdnbabmrlnderfsxxi/Pods-prefix.pch.dia: No such file or directory
There is only 1 file in the Pods-prefix-xxx directory:
Pods-prefix.pch.pth.hash-criteria
Here is my Podfile:
platform :ios
pod 'LibComponentLogging-Core'
pod 'LibComponentLogging-LogFile'
pod 'LibComponentLogging-qlog'
pod 'LibComponentLogging-pods'
pod 'Facebook-iOS-SDK'
pod 'RestKit'
Any help is appreciated. Thank you!
I actually found this solution right here that details opening up Xcode using normal means (Finder or the Dock), as opposed to using the open <Workspace>.xcworkspace command. I've always used Xcode from my dock, whereas the other developer (who couldn't build the project and was getting the error you were) was using the open command from the command line. Once he opened Xcode from the Dock, and manually browsed to open the project that way, he could build it successfully.
If you are using CocoaPods 0.18.0, this might be cause by CocoaPods and is fixed in https://github.com/CocoaPods/CocoaPods/issues/956
Extra quote in "$(inherited)" was the cause (https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/generator/xcconfig.rb#L150). It should not be quoted. If you remove them from the xcconfig the project will build again. You may want to check your xcconfig and see if there are extra quote.
This issue can be caused by a few different factors but in my case and the case of some colleagues, this resolved the missing pch.dia
Uninstall CocoaPods and install 0.17.1
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 0.17.1 --verbose
Lock your Kiwi version to 2.05 if Kiwi is one of your pods:
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi', '2.0.5'
Clean your Xcode project including Derived Data. Close down Xcode, re-open the project and build.

Resources