Every time when I open my app with Xcode I get this error:
ld: library not found for -lGoogleAnalyticsServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Then I need to unmark the target on the libGoogleAnalyticsServices.a file and mark it on again. After the uncheck/check of the target the app runs normally...
I get 2 other warning when this happens:
ld: warning: directory not found for option '-L/Users/vision/Documents/Apps/Mijn Cijfers/Mijn'
ld: warning: directory not found for option '-LCijfers'
Now this looks like Xcode can't read spaces and looks for a new directory called Cijfers. My app is called: Mijn Cijfers, but I never had this problem before with spaces in my project name.
Every time when I check/uncheck the target of libGoogleAnalyticsServices.a the Library Search Path is adding new rows:
I think both cases has to do something with the warnings and errors that I get. It's really annoying to remove the Library Search Paths and check/uncheck the target to let my app run normally. -.-
Does anyone know a solution to solve this odd bug?
You need to delete all these path except the "$inherited" and then add Google Analytics library path (Drag the folder where you saved the library).
If you follow this then you don't need to recheck/uncheck the library path.
If you have just created pod file by running $ pod init command in terminal,
then just close project and Open projectName.xcworkspace instead of projectName.xcodeproj
which will not throw error -lxyzLibray eg. -lJSONModel not found.
Now compile and debug again It will work.
Related
I'm developing a framework "CurrentFramework" with a dependency "Dependency1", it works fine with running the example project, building the framework and testing.
but when i want to gather code coverage for the framework the following error occurs:
duplicate symbol '_lprofMergeValueProfData' in:
/directory/Documents/CurrentFrameworkProject/Pods/Dependency1/Dependency1.framework/Dependency1
/directory/Library/Developer/Xcode/DerivedData/CurrentFramework-hhnbyyjwzomjgjasdrewahvxlmyq/Build/Products/Debug-iphonesimulator/CurrentFramework.framework/CurrentFramework
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried doing this with 3 other frameworks importing "Dependency1", only 1 of them can get the code coverage data without error.
Some people suggested to check if i imported a ".m" instead of a ".h" somewhere but i don't think thats the case(i checked all the files)
This might not be the best answer, but here's some workaround i've done.
Make a file to store excluded symbol (_lprofMergeValueProfData). In this example i name it hidden_list.
hidden_list
Put the file on project root directory.
In your Xcode Project, Go to your Target and search Unexported Symbols File in Build Settings. add your file name containing list to exclude (hidden_list).
excluded_symbols
Run your project again, the error should be gone.
I am trying to create archive of my project and everytime i am getting this error:
ld: can't open output file for writing: /Users/ranbeerhora/Documents/KicksendRepo/KickSend/trunk/KicksendiOSSwift /Build/Intermediates/ArchiveIntermediates/KickSend/IntermediateBuildFilesPath/KickSend.build/Release-iphoneos/KickSend.build/Objects-normal/arm64/KickSend, errno=21 for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i have tried different things but none of the solution works.
I got the answer.I was not giving path of the objective-c bridging header file in the build setting, when i gave the file path it worked.
Explanation:
xcode was not able to open output file for writing because it was not able to access that file since the path was not given when i gave the path xcode found the file and i was able to create the archive.
I am using Flyer and Crittercism in my project . both have libAppsFlyerLib.a and libCrittercism_v4_3_4.a respectively.
Now whenever I open my project and run it I always got this error first time.
ld: warning: directory not found for option
'-LApp/Model/Utility/CrittercismSDK' ld: warning: directory not found
for option '-LApp/Model/CrittercismSDK' ld: warning: directory not
found for option '-LApp' ld: warning: directory not found for option
'-LApp/Model/Flyer' ld: warning: directory not found for option
'-FApp/Model/Fabric' ld: library not found for -lAppsFlyerLib clang:
error: linker command failed with exit code 1 (use -v to see invocation)
To resolve this I have to uncheck and again check Target Membership to Project for both libAppsFlyerLib.a and libCrittercism_v4_3_4.a manually.After that project is running fine.
Why I have to always set membership for .a file manually first time? Am I missing something here?
Because of #trojanfoe's suggestion I get right direction to solve this issue and found that it is happening because it has no library search path in build->setting . So I set path to both .a in library search path file and it works.
I added the XYPieChart folder into my Swift project on XCode 6 but now I'm getting this "Apple Mach-O Linker Error":
duplicate symbol _main in:
/Users/ansariha/Library/Developer/Xcode/DerivedData/Juxta-bjrfrzoyetsowibjdgpcxtesgwtg/Build/Intermediates/Juxta.build/Debug-iphonesimulator/Juxta.build/Objects-normal/i386/AppDelegate-EE692B7EDFB39C7A.o
/Users/ansariha/Library/Developer/Xcode/DerivedData/Juxta-bjrfrzoyetsowibjdgpcxtesgwtg/Build/Intermediates/Juxta.build/Debug-iphonesimulator/Juxta.build/Objects-normal/i386/main.o
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Below that it says "1 duplicate symbol for architecture i386" and then below that, the error: "Linker command failed with exit code 1 (use -v to see invocation)".
Has anyone ever seen this before?
Go to your project Bundle in xcode -> Build Phases -> Compile Sources
Check whether one of the files are added twice or not. This might be the case where such things happen.
Your AppDelegate might be added twice. Remove one of them.
Updated:
Some time you accidentally importing the .m file instead of the .h due to which this error comes. Please check and If this is not the reason, then perform the following steps
1- Check Build phases in Target settings.
2- Go to compile source section.
3- Check if any file exists twice or once.
4- If file exist twice delete one.
5- Build again.
This error occurs duplication of file in your project. click on The Project Navigator and search Duplicate file. in your project duplication of Appdelegate class or main. Remove one of file from your project.
I encounter the following errors
ld: warning: directory not found for option '- L/Users/andrecowardjr/Desktop/Parley/Parley/Google Analytics
ld: library not found for -lGoogleAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Cant find out what the error is. Help needed.
Go into your project settings, check out the field 'Library Search Paths', and edit it so that it reflects where you moved your code/libraries. The error you're running into here is the linker can't find the Google Analytics library that your app is set up to link against (because you moved it).