ld: framework not found error in xcode 8 - ios

I am using xcode 8 for development and cocoapods 1.0.1 for frameworks. After installing frameworks, i couldn't able to build my project. I am getting "ld: framework not found" error. I am using following lines in pod file:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'Sample' do
use_frameworks!
pod 'MBProgressHUD', '~> 0.9'
pod 'TPKeyboardAvoiding', '~> 1.2'
pod 'SDWebImage', '~> 3.7'
pod 'UIActivityIndicator-for-SDWebImage'
pod 'UITextView+Placeholder', '~> 1.2'
pod 'Alamofire', '~> 4.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end

After installing the frameworks, did you closed your project and opened the newly created workspace?
Once you start using CocoaPods to install framework, you must use the workspace as it includes your Sample project and the Pod project containing the frameworks.
In you project directory, make sure to open the .xcworkspace instead of .xcodeproj.
Edit:
If that is not the issue, go to your Sample target/General/Linked Framework and Librairies
You should only have one that should be name something like: Pods_Sample.framework
If you are only using cocoa pods to install frameworks it should be the only one there as it includes all the pods.

select your target -> General ->Embedded Binary , click + ,and add Alamofire.framework

try adding project 'APP_NAME.xcodeproj' to your podfile after use_frameworks! and do pod install again
if you receive warnings like below, after pod install
[!] The `APP_NAME [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-BasePods-APP_NAME/Pods-BasePods-APP_NAME.debug.xcconfig'. This can lead to problems with the CocoaPods installation
Go to Build Settings of your target and add $(inherited) to Framework Search Paths

I had this problem, and it happened a while after renaming my project.
It was using my Pod_Old_Project_Name as a framework.
I fixed this by going to Build Phases -> Link Binary With Libraries, and removed that framework.

There are two reasons this error occurs
I have faced the same issue, This comes only due to change in the
pod file or maybe the pod file may not exist, double check the pod
file and run the cmd pod install
After successfully installing the pod file still if you getting this
error please restart the Xcode, error goes away

Related

using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code

I have razor pay pod in my project for payment gateway and SWRevelViewController file for side bar controller. I selected the swift 5 and iOS version 13 and updated all the pods but still getting error
error: using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code
pod 'Alamofire', '~> 4.5' pod 'TWMessageBarManager'
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '4.2.0'
pod 'SDWebImage', '~> 5.0'
pod 'DropDown'
pod 'MBRadioCheckboxButton'
pod 'SwiftyJSON', '~> 4.0'
pod 'razorpay-pod', '~> 1.1.1'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Firebase/Auth'
pod 'SVProgressHUD'
pod 'FacebookLogin'
pod 'FacebookCore'
pod 'ImageSlideshow', '~> 1.8.0'
pod "ImageSlideshow/SDWebImage"
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'PopupDialog', '~> 1.1'
pod 'GoogleSignIn'
pod 'AppAuth','~> 1.2.0'
I checked your problem and as per you selected project language project work properly in XCode 10.2 but you require changes for updated XCode 11.2.1
Please follow few things :
Make sure first your bridging header file path is proper in build settings.
You need to update razor pay pod because you add tag (pod 'razorpay-pod', '~> 1.1.1'), and pod updated in Swift 5.1 so please remove it and change pod name with pod 'razorpay-pod'
Please change your build settings. Set Build Library for Distribution in the build settings for the target framework to YES.
Hope it’s helpful to you.
In my case, i had to follow these steps:
Step 1:
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
in my Podfile under
...
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
# Put it here (indent like this)
...
Step 2
Select Runner on the left Panel
Under Targets, select the target (usually "Runner")
Select Build Settings from the top Menu
Scroll down to Build Options and find the option "Build Libraries for Distribution"
Set the value of "Build Libraries for Distribution" to NO (or set it for any particular build scheme)
Clean Build Folder
Delete flutter "build" folder, run flutter clean & flutter pub get
This is a similar question (same exact error message) to Xcode 11.2.1 error: Command CompileSwiftSources failed with a nonzero exit code.
I posted an answer that can be found here.
Hope it works for you!
So I faced a problem with Razorpay swift version and following one of the suggested methodologies set Target>Build Libraries for Distribution to Yes.
Big mistake.
kept getting
error: using bridging headers with module interfaces is unsupported
Finally fixed it by setting Build Libraries for Distribution Back to No
[Razorpay issue was still not resolved so had to downgrade Flutter]
I have solved it in this way, Detailed steps are here, Solution to Xcode Error: using bridging headers with module interfaces is unsupported
Solution:
In your Project Level & Target level Build Settings tab, open the Build Options menu. And then set Build Libraries for Distribution option to No.

Xcode - Include of non-modular header inside framework module error when archiving project

I'm currently trying to archive my project to finally update my app on the app store when I came across this issue.
I'm getting this error on multiple files in the XlsxReaderWriter framework.
Include of non-modular header inside framework module 'XlsxReaderWriter.BRARelationship': '/Users/dannyespina/Documents/iOS_Applications/LoanMaster/loan-master/Pods/XMLDictionary/XMLDictionary/XMLDictionary.h'
I had issues with this framework in the past but unfortunately this is the only one of it's kind that writes to excel files. I had to makes some changes in order for it work as shown here.
I tried everything to fixed this such as:
setting "Allow Non-modular Includes in Framework Modules" to YES to both the Pods project and LoanMaster
Cleaning the project and deleting the derivedData a bunch of times
Reinstalling Xcode.
placing XMLDictionary.h as a public header as mentioned in one of the stack overflow answers
Making sure that the framework is public
Updated pods to the latest version (1.8.4)
The strange thing is that I archive this project in the past with this framework with the same exact changes to it. The library hasn't been updated in 3 years so nothing new should had cause this. Is this an issue with the new version of Xcode?
I really just want to update my app that I been working on for the past 6 months :(
Any help will be amazing!
Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'LoanMaster' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for LoanMaster
pod 'MPNumericTextField', '~> 1.4.0'
pod 'Charts', '~> 3.2.1'
pod 'LGButton'
pod 'RealmSwift'
pod 'SpreadsheetView'
pod 'IQKeyboardManagerSwift'
pod 'GoogleMobileAdsMediationMoPub'
pod 'PersonalizedAdConsent'
pod 'PopupDialog', '~> 1.1'
pod 'NVActivityIndicatorView'
pod 'FBAudienceNetwork'
pod 'Firebase/Core'
pod 'Firebase/AdMob'
pod 'XlsxReaderWriter', '~> 1.0'
pod 'M13Checkbox'
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['SpreadsheetView', 'IQKeyboardManagerSwift', 'NVActivityIndicatorView'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
target.build_configurations.each do |config|
config.build_settings['CLANG_WARN_DOCUMENTATION_COMMENTS'] = 'NO'
end
end
end
end
end
I solved the problem by adding XMLDictionary.h to my public headers for XlsxReaderWriter and changing import "XMLDictionary/XMLDictionary.h" back to "XMLDictionary.h".
I followed this answer
I hope this helps someone who's still using this old and forgotten framework.
Try to remove pod for XMLDictionary from podfile and add again it will be work.

Module not found - cocoapods

I'm trying to pod install this library into my project's (lets say child xcodeproj) parent project (lets say Parent xcodeproj).
Child .xcodeproj has its own podfile where I have added RxSwift, RxCocoa, Realm and this GeoSwift library. Here is the cocoapods file as show below
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "9.0"
inhibit_all_warnings!
use_frameworks!
project 'LocationManager/LocationManager'
def pods
pod 'GEOSwift'
pod 'RxSwift', '~> 4.0'
pod 'RxCocoa', '~> 4.0'
pod 'RealmSwift', '~> 3.0'
end
target 'LocationManager' do
pods
target 'LocationManagerTests' do
inherit! :search_paths
pod 'RxBlocking', '~> 4.0'
pod 'RxTest', '~> 4.0'
end
end
This LocationManager is installed into another XCode project as another podfile
def location_pods
pod 'GEOSwift'
pod 'LocationManager', :git => 'git#github.com:myrepo/locationmanager.git', :branch => 'users/me/add-geoswift'
end
target 'TestApp' do
location_pods
project 'TestApp.project'
end
When I try to compile the TestApp target, XCode throws an error as below
GeoSwift module is not found. This error is inside the Pods > LocationManager > MockLocationManager.swift The same module imported else where in that Pods > LocationManager works. Also import RxSwift and import RxCoca works. When I accessed Pods > Targets > LocationManager > Build Phases > Target Dependencies I see all the pods except GeoSwift
May I know how to fix this issue? Adding GeoSwift to this targetDependency doesn't compile either. When compiling LocationManager.xcworkspace as a separate entity it works perfectly fine. That module import GeoSwift doesn't throw any compilation error.
I had an issue similar to this.
Go into Pods:
Then click on "Build Settings", find the row titled "Swift Language Version", and try updating it to the latest (in my case, it was 4.1).
This worked for me! Hopefully it helps someone else out there too.
More info: Xcode 9 Swift Language Version (SWIFT_VERSION)
From what I know Cocoapods do not support sub-projects. I had an issue with this too and I promoted all my sub-projects as folders within the main project and put them under a different target. Now those targets can use Cocoapods too.

Xcode and Cocoapods "No such module" error

I recently upgraded to Xcode 8 and an existing project to Swift 3. After having a variety of issues with Cocoapods, I decided to start over from scratch. After running pod deintegrate and deleting Podfile, Podfile.lock, and [Project].xcworkspace, I had a blank slate as far as Cocoapods was concerned.
I then took the following actions:
Opened a terminal at the project location and ran pod init, then pod install (using the stub Podfile that pod init creates).
This appeared to be successful, but came with the following two warnings:
[!] The `Xena [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Xena/Pods-Xena.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `Xena [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-Xena/Pods-Xena.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
At this point, opening Xcode and building the project gives the "No such module" error, which is entirely expected.
Following the instructions at this question solves this problem and rerunning pod install is a success.
Closed Xcode, added the modules I'm using to the Podfile (see below), the ran pod install again. According to the terminal output, this is successful.
Opened Xcode and built the project. I again receive the "No such module" error, specifically No such module 'ReactiveCocoa'
I have confirmed that the same problem occurs with SnapKit, Hue, KMPlaceholderTextView, KeychainSwift, and Siren, depending on the order of the import statements. For some reason, none of the Google modules are affected by this problem.
My Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Xena' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Xena
pod 'ReactiveCocoa', :git => 'https://github.com/ReactiveCocoa/ReactiveCocoa.git'
pod 'SnapKit', '~> 3.0.2'
pod 'Hue', '~> 2.0.1'
pod 'KMPlaceholderTextView', '~> 1.3.0'
pod 'GooglePlacePicker'
pod 'GooglePlaces'
pod 'GoogleMaps'
pod 'KeychainSwift', '~> 7.0'
pod 'Siren'
target 'XenaTests' do
inherit! :search_paths
# Pods for testing
end
target 'XenaUITests' do
inherit! :search_paths
# Pods for testing
end
end
Make sure you are opening .xcworkspace and not .xcodeproj file.
You may further look into this post.
Also under : Target > General > Linked Frameworks and Libraries
Make sure your frameworks are there. Even Pods_Xena.framework is there
Try:
Xcode ->Preferences ->Location ->DerivedData
open the folder DerivedData and move it to Trash
Uncomment the next line to define a global platform for your project
platform :iOS, '9.0'
Uncommenting the second line in your pod file will help you.

No such module ... in Xcode

I've run into a problem with Xcode (using Swift) that has me completely stumped. I realize that this question has been asked and answered, but none of the answers have worked for me, and my situation seems to be a bit different than the others, as all of my pods are failing (not just a specific one). They all worked fine a week ago.
I use Cocoapods for some of the more common Swift frameworks (e.g. Alamofire, Eureka, Kingfisher, SwiftyJSON, etc.). They were all working fine in Xcode 7. However, one of the (automatic) updates bumped up my Xcode version, after which it became mandatory to specify your target in the podfile. I did this and ran pod install. The pods are all still there, but now every import statement that relates to these frameworks fails.
At first I thought it was an Alamofire issue, as that's the first one that failed with the "No such module 'Alamofire'" error. I tried everything I could with Alamofire, including the following:
Clean and rebuild
Clean build folder
Restart Xcode
Re-boot computer
Delete all derived data
Added framework to "Linked Frameworks and Libraries"
Added framework to "Link Binary with Libraries"
Verified that I am opening the workspace rather than the project
Re-installed CocoaPods
Re-installed Xcode ver 7.3.1
Nothing would remove the "No such module ..." error. Finally, I removed Alamofire from the pods and just dragged the Alamofire project into my project. This allowed me to remove the import statements for Alamofire. However, to my dismay, now the next framework caused "No such module". I moved the next three frameworks into my project, and it looks like it is just going to keep going. Apparently, none of my Pods frameworks are being recognized anymore. I installed Xcode 8 and tried that with Swift 2.3, but I get the same "No such module" errors.
I really would prefer to use Cocoapods, as it makes upgrades a lot easier, along with other bonuses. I'm guessing I have some setting wrong that is screwing up all my pods, but have not had any luck finding it. This is a bit of a disaster as it has shut down development for several days, with no sign of a fix. If there is anything I can do or provide to assist in finding a solution, just let me know. If anyone could provide any possible solutions or even things to try, it would be greatly appreciated. I'm currently working with Xcode version 7.3.1.
My pod file looks something like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'Y2GOsp' do
use_frameworks!
# Pods for Y2GOsp
pod 'Alamofire', '~> 3.0'
pod 'AlecrimCoreData', '~> 4.0'
pod 'Kingfisher', '~> 2.4'
pod 'Eureka', '~> 1.6'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7'
pod 'PhoneNumberKit', '~> 0.1'
pod 'PKHUD'
pod 'Dollar'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.2'
end
end
end
Comments from #l'L'l led me to the solution. I went to
build settings > frameworks search path
and set it to the following:
$(inherited) (non-recursive)
$(PROJECT_DIR)/build/Debug-iphoneos (non-recursive)
$(SRCROOT) (recursive)
It is now correctly finding the pod frameworks.
Make sure you opened the .xcworkspace file in Xcode and not just the .xcodeproj file.
In Pod file
Uncomment below lines to define a global platform for your project
platform :ios, '10.0'
use_frameworks!
Now in xcode
a) Clean your project
b) Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO"
c) Now, build project
Sometimes pod deintegrate and then pod install helps me as well
try to make the version of your SDK into earlier versions
pod 'Alamofire', '~> 3.0'
pod 'AlecrimCoreData', '~> 4.0'
pod 'Kingfisher', '~> 2.4'
pod 'Eureka', '~> 1.6'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7'
pod 'PhoneNumberKit', '~> 0.1'
pod 'PKHUD'
pod 'Dollar'
for example change 3.0 to available previous version, it worked once for me when i was facing the same issue.
pod 'Alamofire', '~> 2.4' #I am assuming prev available version is 2.4
But it doesn't have to be the "Alamofire" version result in "No such Module", you may try every one in your list in the pod file.
I had the same problem and I just solved it by making sure that my "Find Implicit Dependencies" is checked. Go to Edit Scheme -> Build. Previously I uncheck this so my xCode will run a little bit faster. Never realized that it will later throw me this error.
Although the question is long time ago, "no such module" error made me in Xcode 13 struggle for 3 days. I found many different solutions here, but still cannot fix it. Until I tried applying different solutions together and found my own solution.
My issue is that I can build the app on device, but shows "no such module" when building it on simulator. It seems there is something wrong while building pods.
Therefore, I added use_frameworks! & use_modular_headers! in Podfile.
target 'Application' do
use_frameworks!
use_modular_headers!
pod 'ChameleonFramework/Swift', :git => 'https://github.com/wowansm/Chameleon', :branch => 'swift5'
pod "BSImagePicker", "~> 3.1"
pod 'FirebaseCoreInternal'
I also changed the Build Setting of the Pods to exclude building pods in architecture of arm64. I did the same in my Project and Target's Build Settings.
Image of Pods' Build Settings
Please note that if you install new pod to the project, the Build Settings of Pods will be reset. You need to mannaully change back to exclude arm64.
For me the problem was that I updated the name of a build configuration within my project, but I didn't select the new build configuration in the scheme that used that build configuration. Updating the build configuration within the scheme to the new name fixed the issue!
You should excluded Architecture to nothing, also I did run the pod install command to install the pods.

Resources