I am using cocoa pods to integrate multiple third party files into my project.
I have to integrate below pod into my project
xcodeproj 'MyApp'
workspace 'MyApp'
source 'https://github.com/CocoaPods/Specs.git'
target :"MyApp", :exclusive => true do
platform :ios, '7.0'
pod 'AFNetworking', '2.0.2'
pod 'TwilioSDK', '~>1.2.2'
pod 'SocketRocket', '0.3.1-beta2'
pod 'AppRTC'
end
When I run pod install. I get duplicates as shown below..
When I build my app I am getting error
ld: warning: directory not found for option '-L/Users/anand/Documents/
Project/myApp_Backups/myApp_June/myApp_WEBRTC/Pods/build/Debug-
iphoneos'
duplicate symbol _MD5_Update in:
/Users/anand/Documents/Project/myApp_Backups/myApp_June/
myApp_WEBRTC/Pods/AppRTC/Lib/libWebRTC.a(nss_static.md5.o)
/Users/anand/Documents/Project/myApp_Backups/myApp_June/
myApp_WEBRTC/Pods/TwilioSDK/Libraries/libcrypto.a(md5_dgst.o)
duplicate symbol _SHA1_Update in:
duplicate symbol _OBJC_IVAR_$_SRIOConsumer._readToCurrentFrame in:
/Users/anand/Library/Developer/Xcode/DerivedData/myApp-
gxdbyoohznnpigavdqmaeilzlavd/Build/Products/Debug-iphoneos/libPods-
myApp-SocketRocket.a(SRWebSocket.o)
/Users/anand/Documents/Project/myApp_Backups/myApp_June/
myApp_WEBRTC/Pods/AppRTC/Lib/libWebRTC.a(socketrocket.SRWebSocket.o)
ld: 71 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I thought to do below solutions:
1) Remove SRWebSocket.h file -- but it may get errors as it is in Pods.
2) Remove pod 'SocketRocket', '0.3.1-beta2' from pod file and run pod install -- but I used both SRWebSocket.h and SRWebSocket.m in my project before installing AppRTC into my project..!
Please suggest how can I solve this issue..
Thanks in Advance..!
I have fixed the above issue as below
At my Xcode project -- Build Settings -- Other linker Flags -- I removed -all_load then some of the duplicate errors are gone.
Still I get Socket Rocket duplicate warnings after the above solution.
I fixed this by going to Pods Project -- Selected Socket Rocket pods target -- Removed the SRWebSocket.m file from Compiling. It works fine and duplicates are removed.
Thanks for all answers..
You need to remove the socketrocket object code from libWebRTC.a
run lipo -info libWebRTC.a to see what architectures are in the library (current version is i386, armv7, and arm64)
Then run
lipo libWebRTC.a -thin i386 -output libWebRTC-i386.a
Do this for each architecture by replacing i386 with the relevant value. You then need to extract the object files from each archive.
mkdir libWebRTC-i386 && cd libWebRTC-i386 && ar -x ../libWebRTC-i386.a
Do this for each of the new single architecture libraries you've just created. In each of the new folders you will find .o files that contain "socketrocket" - delete these.
Then re-archive the object files for each architecture
libtool -static *.o -o ../libWebRTC-i386.a
Once you have done this re-combine them into a fat library
lipo -create libWebRTC-armv7.a libWebRTC-arm64.a libWebRTC-i386.a -output libWebRTC.a
And voila, it should now work. Really the libWebRTC.a binary needs re-building without the socket rocket object code, and socket rocket should be added as a dependency to the podspec.
Solution
Backup your project
Close the Xcode
- install this gem on terminal:
https://github.com/kylef/cocoapods-deintegrate
run the command line below :
pod deintegrate
remove the Podfile.lock file in your project directory
run install again :
pod install
Open Xcode and Clean your project and Derived Data directory then run again
Hope this solution will fix your problem.
Best
In your build phases, check to see that you aren't compiling the same file more than once.
In your case, maybe there're two same m files in Compile Sources, just remove one and try to rebuild.
Follow the below steps to resolve your duplication symbol error.
1) Select your Xcode Project > Navigate to "Build Phases".
2) From there, search the file name for which you are getting duplication.
3) If possible, then there might be more than one ".m files" for your search keyword.
4) Remove all the files except one which you need to actually compile.
5) Same way follow the process for all the duplicate error
6) That's it! Your problem will be solved for sure.
Create an issue for AppRTC repo to remove the header and set a dependency on SRWebSocket instead.
As a temporary solution - link AppRTC to a local path with :path directive and remove this file from the local directory. Or you may link to a local podspec file with ignorance on SRWebSocket header in exclude_files config.
Now it's very easy to remove duplicate pod files or any pod which is not in use for your project.
open your pod file.
comment all pod file which you want to remove.
use commend pod install
you will your all comment pod will remove in terminal
Enjoy your day with a cup of tea or coffee while doing code.
Related
Code Signing .framework failed. Have included framework manually .
Tried to remove from embed binaries and included in pod file. I am getting error on pod install. This is how I have added the local framework to pod file
pod 'Framework_name',
:path => '../APP_ROOT_FOLDER/Resources/LibFolder/'
Error:
"No podspec found for ..
Not sure whether this will resolve Code Signing failed issue
Tried to include the framework in to pod file, but pod install failed
Got this issue resolved need to remove simulator architecture from the frameworks that we include in iOS App, on uploading it to TestFlight. Command to check if simulator architecture is present :
lipo -info
Command to remove simulator architecture from Framework:
lipo -remove x86_64 -output
Trying to insert Google Ads/Firebase into a test app. Suspect I've almost got this working but. Using the Google notes from https://firebase.google.com/docs/admob/ios/quick-start
When I compile I receive "Linker code failed with exit code 1":
ld: warning: directory not found for option '-L/Users/edward/Library/Developer/Xcode/DerivedData/TotalConversion-gtwxqoywudjqpodqkpfpwcnovyuz/Build/Products/Debug-iphoneos/GoogleToolboxForMac'
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have created the Podfile as instructed with:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ’7.0’
target 'TotalConversion' do
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
and then run a pod update. I don't see a .xcworkspace file referred to in the docs. Does the iOS, '7.0' line above need to be altered?
I presume that using pods GoogleAds is instead of the standard framework (Build Phases/Link Binary) approach.
If there is a linker error, this might be few things. First, check if you haven't open .xcodeproj instead of .xcworkspace by mistake. If not, the solution might be simple project cleaning by pressing cmd+shift+k. At last, check if those libraries are linked with project and are having status required in your target's general/build phases (Pods_YourProjectName.framework).
In Podfile you can actually comment out lines with source and platform by placing # in front of them. Go to terminal, cd to your project directory and try pod install once again, maybe that will do the job.
Sorry for not placing this in comments but my reputation doesn't allow me doing it.
The {projectName}.xcworkspace folder should be in the same folder as the .xcodeproj that you have open. Close Xcode {projectName}.xcodeproj instance and open {projectName}.xcworkspace using the Finder, command line, or Xcode open.
I am trying to install admobs in my iPhone App (written in objective-c). I have implemented this many times using swift projects, but currently I keep getting the following build error:
ld: warning: directory not found for option '-L/Users/charlieseligman/Library/Developer/Xcode/DerivedData/ThamesClippers-csissodainpbbjenykdyxuutzxtg/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/charlieseligman/Documents/GIT/iOS.ThamesClippers/build/Debug-iphoneos/GoogleToolboxForMac'
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am definitely opening the .xcworkspace file (and not the .xcodeproj file).
I have also tried deleting 'DerivedData' folder contents & 'Cleaning' the project and doing a 'Clean Build Folder'. None has resolved the issue.
My podfile only includes the following pods:
# Pods for ThamesClippers
pod 'Google/Analytics'
pod 'Firebase/Core'
pod 'Firebase/AdMob'
# Trying to fix GoogleToolboxForMac missing error
pod 'Firebase/Messaging'
pod 'GoogleToolboxForMac/Logger'
pod 'GoogleToolboxForMac', '~> 2.1'
I have tried adding the bottom 3 one-by-one but kept getting the same build error.
Can anyone help? At a complete loss on this one. Seen these two questions but their accepted solutions have not resolved this issue:
Framework not found GoogleToolboxForMac
ld: library not found for -lGoogleToolboxForMac
Finally worked out a fix:
Xcode > Product > Scheme > Manage Schemes
Select to 'Show' the scheme that was failing (GoogleToolboxForMac)
Select this scheme in the dropdown, just to the right of the 'Stop' button
Build this scheme
Then select the original scheme (in the dropdown mentioned in step 3) and rebuild
All built correctly.
So it looked like I had to build the separate scheme manually.
Note: To build these automatically, use Product > Scheme > 'Edit Scheme' > Build > And make sure all targets are added with your project target at the bottom.
I got this error in Xcode 10 when building to the Simulator. This is because I deleted the Debug base configuration in the xcodeproj when attempting to resolve the Cocoapods warning:
"CocoaPods did not set the base configuration of your project because your project already has a custom config set."
I resolved the issue by:
Adding the Debug base configuration
Setting the Debug configuration value to None
Running pod install
This is how the base configuration should look like after step 3:
]1
recently I have update to xCode 6. In my project where I am using cocoapods, after update my pods, I am dealing with an error I can`t resolve and need help. Similar questions in the forums don't resolve my problem and I need other point of view.
The error is:
duplicate symbol _OBJC_METACLASS_$_PodsDummy_Pods_myapp in:
/Users/myuser/Library/Developer/Xcode/DerivedData/myapp-cojufufwukcibtcgwjgdbqesleta/Build/Products/Debug-iphoneos/libPods-ibizahelp.a(Pods-myapp-dummy.o)
/Users/myuser/Library/Developer/Xcode/DerivedData/myapp-cojufufwukcibtcgwjgdbqesleta/Build/Products/Debug-iphoneos/libPods-IbizaHelp.a(Pods-myapp-dummy.o)
duplicate symbol _OBJC_CLASS_$_PodsDummy_Pods_myapp in:
/Users/myuser/Library/Developer/Xcode/DerivedData/ibizahelp-cojufufwukcibtcgwjgdbqesleta/Build/Products/Debug-iphoneos/libPods-ibizahelp.a(Pods-myapp-dummy.o)
/Users/myuser/Library/Developer/Xcode/DerivedData/myapp-cojufufwukcibtcgwjgdbqesleta/Build/Products/Debug-iphoneos/libPods-IbizaHelp.a(Pods-myapp-dummy.o)
ld: 2 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
my Podfile is:
#Uncomment this line to define a global platform for your project
platform :ios, '6.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'myapp' do
pod 'MWPhotoBrowser'
pod 'AFNetworking', '~> 2.0'
pod 'UIActivityIndicator-for-SDWebImage'
end
Please I am stuck
I've had it after target name update, it added pods framework twice - removing the old framework solved it.
Project > Target > Linked Frameworks and Libraries
(remove with "-")
go to Finder click ALT and see GO option you will find library and click on application delete derived data.Xcode 6 is entirely new format of data storage.so delete old xcode derived data.
Finally I have found a solution.
It seems that the cocoapods have changed something or my proyect had a problem in the name, not sure at all but my target configuration had an specific configuration set, and cocoapods needs its own.
my configuration set was Pods-myappname-xconfig.release and I the correct was Pods-xconfig.release that was located in the pods folder when install them.
Once I have changed it, the error disappear and I just had to remove from link libraries the old library related to that config.
if anyone has similar issues, I will be glad of help him
I am getting the following error when trying to build a project I found on GitHub.
ld: library not found for -lPod
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've heard of some people saying to use the workspace file instead of the workspace file but there is no project file.
Here is the project
My app can run on simulator but can't run on device.
I fixed this by these steps.
The Pods Xcode project now sets the ONLY_ACTIVE_ARCH build setting to YES in the Debug configuration. You will have to set the same on your project/target, otherwise the build will fail.
Ensure your project/target has an ARCHS value set, otherwise the build will fail.
When building a iOS project from the command-line, with the xcodebuild tool that comes with Xcode 4, you’ll need to completely disable this setting by appending to your build command: ONLY_ACTIVE_ARCH=NO.
http://guides.cocoapods.org/using/troubleshooting.html
All my pods project have debug build only active architecture to YES(from pod install), but my project set to NO. So, I change it to YES, then it's work.
This project uses Cocoapods to manage its third party dependencies. Whilst the developer has committed the Pods/ directory, it's probably best to install the Pods yourself:
Install Cocoapods if you don't already have it: sudo gem install cocoapods
cd into the top level project directory, and install the required Pods for this project: pod install
Open the TestOCR.xcworkspace that will be created.
Build and run.
I got it working, all I had to do was simply drag the Pods.xcodeproj into the TestOCR.xcodeproj thanks for the help.
I have encountered this issue couple of times and the common fix is to simply build the Pods target.
The project seems to have bad CocoaPods configuration (or not at all). There is no workspace and no Podfile (which is even worse, because if there's a Podfile you can install CocoaPods by your own and update pods).
You can look into Pods directory and try to create Podfile from scratch (depending on found libraries) and the install CocoaPods. This should work.