library not found for -lBaiduMapApi - xcode

I use cocoaPods in my current project.
Because the 'Baidu map iOS SDK' don't have a pod spec so I just create one.
The 'Baidu map iOS SDK' use a '.a' static library and some header files, I add them into my project through cocoaPods
But when I build my project, it always has an error:
ld: library not found for -lBaiduMapApi
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I google it then I try to set the Library Path in Xcode.
Both in my project and the target in Pods.
I am sure the path is correct, but the error still there.
Can somebody help me?

It's weird......
I remove whole my project and Recreate a new one.
And config the Podfile, update .....
When I back to the Xcode, build, Success!!!
I can find another way to solve this problems

Related

Can't compile App from Titanium Appcelerator with iOS OpenCV Module

I have an issue that is going on for over a month and I can't find any solution for it.
I created an Appcelerator Titanium Module, which uses the OpenCV framework.
I tried literally everything I found on the internet to make it work, but no sucess.
The module compiles, but it crashes when building the App that uses it.
To dig deep in the problem, I compile the App via CLI using appc run -p ios -l trace to see the whole thing. This is what I get:
[TRACE] ld: framework not found opencv2 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
This happens if I declare the framework in the module.xconfig file, like this:
OTHER_LDFLAGS=$(inherited) -framework opencv2
If I don't declare it in the file, I get:
[TRACE] symbols not found for architecture x86_64 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
Well, the opencv2.framework file is inside the /ios folder in the module.
This is what I tried so far, to put the OpenCV Framework in the project:
OpenCV Official Example for XCode
Compiling it from scratch and then adding to the Project
brew install opencv and then adding it to the project
I configured Framework Search Paths like this:
$(inherited) $(PROJECT_DIR) $(SRCROOT)
Header Search Paths like this:
$(inherited) "$(TITANIUM_SDK)/iphone/include" /usr/local/Cellar/opencv/4.4.0/include (this last one, when installed by brew CLI command.
The Other Linker Flags, is configured like this:
This configuration I got from this tutorial: OpenCV on XCode
And finally, I tried adding the .dylib files from the source of the OpenCV Framework in the project by right-clicking the project's name and Add Files.
So, I tried everything I could find to solve it, but I can't get it to work.
Sorry for the long question, but I am completly out of ideas on how to make this work.
Please, help me!
First of all, the opencv2.framework is copied automatically to the XCode /ios folder (if you selected Copy Files if Needed). BUT, Appcelerator needs 3rd party frameworks to be put on /ios/platform folder. So, I moved it there.
Secondly I added -lz to the Other Linker Flags in Build Settings.
This solved the problem. I must thank the team and developers from TiSlack (An Appcelerator platform community), which helped me through this. Michael and Hans, Thanks!
Here is a video that helped me install OpenCV4 on my Macbook Pro Mojave 10.14.6. I tried installing OpenCV using another video and it led me to getting a linker error that was similar to yours.
Basically, the problem was the path I specified as for my /lib and /include folders.
https://www.youtube.com/watch?edufilter=NULL&v=HxNZEa7Slyk

iOS build: command ld failed with a nozero exit code

For a react-native project, I got the following error during Xcode build:
clang: error: no such file or directory: '/Users/user172615/Library/Developer/Xcode/DerivedData/xxx/Build/Products/Debug-appletvsimulator/libBVLinearGradient.a'
Command Ld failed with a nonzero exit code
This happened after adding react-native-linear-gradient, and following the instructions in https://github.com/react-native-community/react-native-linear-gradient (manual installation for iOS).
As specified in https://github.com/react-native-community/react-native-linear-gradient#manually, libBVLinearGradient.a is included in Build Phases -> Link Binary With Libraries for the target myProject
libBVLinearGradient.a is also included in General -> Frameworks, Libraries and embedded content.
I tried deleting DerivedData, and rebuilding. Didn't help.
Since the error indicates Debug-appletvsimulator, I included libBVLinearGradient.a in Build Phases -> Link Binary With Libraries for the target myProject-tvOS
When this didn't help, I deleted the myProject-tvOS target. All didn't help.
I am using Xcode 11.3, react-native 0.59.9.
Any idea?
Instead of downloading it, do this instead.
Click on clone existing project
Then copy this link
https://github.com/react-native-community/react-native-linear-gradient
And paste the link here
Then it will download the project.
If the problem still happens, then create a new project, copy and paste everything.

AFNetworking - ld: library not found for -lAFNetworking

I have an Xcode project with Cocoa Pods installed which I added a tvOS single view app target. I shared with the tvOS target all the pod installed. When I build and run my iOS target everything is ok, but when I run the tvOS target I get this error
"ld: library not found for -lAFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)"
So after searching on the web I found a solution to this error. If I go to the Build Settings for the tvOS target and under Valid Architectures I remove arm64 and type armv7 the error disappears but then when i run the project i get this: the file couldn't be opened because you don’t have permission to view it.
First, you must sure you're opening the .xcworkspace file, not the .xcodeproj file.
Then, open your project folder and run command pod install and reopen .xcworkspace file it will fix your issue.

XCode 8 - Build works but archive fails - React Native

I have an haunting issue. I am trying to build an React Native app in Xcode 8. Build/Run in Simulator works fine but as soon I start to archive I am getting the following error:
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
That's the only error and it's after all steps have been completed with no further explanation.
Now I installed Fastlane and found out that it fails because of duplicate symbols. Removing the duplicates from "Linked Frameworks and Libraries" solves the issue and allows me to archive the app.
However now I can't build anymore for the simulator because of missing symbols.
I been looking into this for 2 days now and I can't find a solution.
Anyone has an idea why this is happening and how to solve it?
I found the solution for it!
Based on this thread https://github.com/facebook/react-native/issues/12814 if you use Pods, it also includes the base react project which will end up causing the duplicate references.
In order to fix this issue, the react reference need to be removed:
Open your [yourproject].xcworkspace
Select your Pods project
In TARGETS delete React. (clicking on the minus button - below of the targets list.)
Clean (Product > Clean) & archive/build/whatever.
Kudos to andfk for this solution!

How to add spotify framework to an custom pod

I try to add the Spotify framework to my custom cocoaPod project but i got an error :
ld: framework not found Spotify
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i added the framework in the Build Phases of project and the search Path to.
but can't build.
Any one can help me please.
Sorry for my bad english.
Are you following some kind of tutorial for this? This shouldn't be an issue with Cocoapods, unless I'm misunderstanding something.
Make sure you clean your project first. I would remove the work you did in Build Phases, the intention of Cocoapods is to avoid adding frameworks manually as an embedded dependency.
Before a pod install, close your project. Pod install and then open up your workspace file once complete, not your xcodeproject file. Try building now. Build again with your imported pod statement. Please update if you need help further.

Resources