I'm trying to add OCUnit tests to an existing project (in XCode 4.6.3). I followed the instructions here - http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/ however I'm getting 78 Mach-O errors only when trying to run the tests. I can compile the main target just fine.
One thing to note I have not modified the tests yet, they are just the standard template. I'm not sure example what I'm doing wrong.
One error message
Undefined symbols for architecture i386: "_AudioComponentFindNext",
referenced from:
l651 in libNuanceSpeechAnywhere.a(libSpeechKit.a-i386-master.o)
l652 in libNuanceSpeechAnywhere.a(libSpeechKit.a-i386-master.o)
Here is a screen shot of a bunch of the errors.
After banging my head against the keyboard for a few hours, I found this solution if you're using CocoaPods:
In your podfile, add your test target as well with the necessary dependencies
workspace 'MyProject'
target 'MyProject' do
use_frameworks!
pod 'Alamofire', '~> 4.0'
pod 'RealmSwift'
end
target 'MyProjectTests' do
use_frameworks!
pod 'Alamofire', '~> 4.0'
pod 'RealmSwift'
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
Then just run pod install and everything should end up configured correctly. I recommend running pod install --verbose so you can see if there are any warnings. If you manually edited the build configuration, Pod will complain about it. Follow the recommendation and then reinstall. Works like a charm.
You have to add AudioUnit framework to your project first and then rebuild it.
This is how you add frameworks to your project.
Related
I am attempting to run sample code from Esprissif for their ESPProvision library, it comes with the following podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'ESPProvisionSample' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for ESPProvisionSample
pod 'ESPProvision'
pod 'MBProgressHUD'
target 'ESPProvisionSampleTests' do
inherit! :search_paths
# Pods for testing
end
target 'ESPProvisionSampleUITests' do
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
config.build_settings['ARCHS'] = 'arm64'
end
end
end
This runs successfully when I run pod install and the pods seem to be correctly installed within the pod file structure, however when i try to build the project I get the error:
No such module 'ESPProvision'
I am new to coding in swift, but in my previous project, simply having the pod file installed was enough for the file to be able to be found anywhere within the code of the app. Do I need to explicitly call the library using its relative pwd?
I also attempted clearing the derived data and I attempted re-installing the pods, but it didn't help.
File structure for the relevant files if it helps:
- ESPProvisionSample
- Provision
- ConnectViewController.swift // this is where 'import ESPProvision' is called and not found
- Pods
- Pods
- ESPProvision
EDIT:
I've also now tried to build the ESPProvision module separately by going to Product -> Scheme -> New Scheme and selecting ESPProvision, it built successfully but when I built the main project it once again gives me the same error as above.
Also for clarity yes I am running the project using the generated .xcworkspace file
It seems maybe the framework is missing from ESPProvisionSample -> Frameworks folder, could it be that?
I'm closing this question, it was an issue with the library itself. I opened a ticket with Espressif and they updated their code https://github.com/espressif/esp-idf-provisioning-ios/issues/57
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.
I struggle with integrating Realm in my project.
Actually, I'm following guidelines from official documentation, though that doesn't help me.
While I'm trying to import RealmSwift I got "No such module".
import RealmSwift
In framework Realm.framework is red.
Here is my Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'RealmTest' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for RealmTest
pod 'RealmSwift'
target 'RealmTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'RealmTestUITests' do
inherit! :search_paths
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3' # or '3.0'
# Pods for testing
end
end
end
end
I had some issues getting it installed as well. This may not be the answer but after working through these, my project is building:
Here's my PodFile which is similar
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'RealmTest' do
use_frameworks!
# Pods for RealmTest
pod ‘RealmSwift’
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
I had to update CocoaPods
$ sudo gem install cocoapods
then install Realm again, quit Xcode then
pod install
from there use the
.xcworkspace
file generated by CocoaPods to open the project.
And the last item was to manually add two files to the Linked Frameworks and Libraries section.
Open your project via the .xcworkspace, select your project in the left column. Then select General on the right and scroll down the Linked Frameworks and Libraries and add these two files
Realm.framework
RealmSwift.framework
That last step seems unnecessary but we could not get the build to work until we did that step.
Oh!
Actually the problem was in Swift Compiler - Version
Who would have similar problem, try to go to Build Settings - Swift Compiler - Version - Use Legacy Swift Language Version - Switch it to "No"
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
I am using Xcode 6.4 and installed QuickBlox framework using cocoapods. After using the framework I am getting some errors like
Undefined symbols for architecture arm64
"_OBJC_CLASS_$_QBSettings", referenced from:
objc-class-ref in AppDelegate.o
Would anyone please help me to figure out. I am not able to fix this. Any suggestion will be appreciable.
Update:
Below is my pod file
pod 'QuickBlox'
target 'myApp' do
Go to your target Build Settings -> Other linker flags -> double click . Add $(inherited) to a new line. This will fix the issue.
You can find more detail by using below link
The target ... overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig
So I have been trying for days to figure out why quickblox package is not letting me build the app in ios. After a lot of clean project, pod installs etc. I came out to a conclusion. Whenever I create an app with swift language selected in android studio I have the same error with you but whenever I select objective-C as IOS language the app is running properly. In my opinion, It is prop an error-bug of the package which needs to be fixed by quickblox developers.
After getting in touch with QuickBlox developers I was provided with the following information :
At this moment for correctly launch samples in iOS simulator you need update pod file with next snippet:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
And reinstall the pods.
Podfile example (update pod file for the chat sample swift):
platform :ios, "13.0"
use_frameworks!
inhibit_all_warnings!
target 'sample-chat-swift' do
pod 'QuickBlox', '~> 2.17.10'
pod 'SVProgressHUD'
pod 'SDWebImage', '~> 4.4.7'
pod 'TTTAttributedLabel', '~> 2.0.0'
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
They promised to release a new SDK within a month.