问题
I added Google Analytics by CocoaPod into my project, but my app crashed and gave the following error.
ld: framework not found FirebaseAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What should i do to solve this issue ? I followed this tutorial from google to integrate the Google Analytics into my project.
回答1:
You are probably using cocoapods to add Firebase. Make sure that in the build settings for your target the 'Framework Search Paths' both for Debug and Release start with $(inherited)
.
The build settings for your pod dependencies are defined in a xcconfig file, if you don't have $(inherited)
in your target's build settings, the settings from this file will be ignored.
回答2:
I had the same error, my Framework Search Paths
in Build Settings
were already set to $(inherited)
for both Debug and Release.
I managed to solve this with the solution here: https://stackoverflow.com/a/38246169/1092815
In other words, Podfile.lock
had some bad versions in it, running this solved the my issue:
pod update
pod install
回答3:
I also had this issue and resolved with this:
pod deintegrate && pod install
CocoaPods doc on pod deintegrate: https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate
回答4:
You need to remove linked framework from project properties.
回答5:
I had this issue and resolved it: - Go to Info.plist -> Build Settings -> Framework Search Paths - Verify/fix the paths. In my case, it was the additional Fbsdk search path that was causing issue (see attached picture) error
I changed it to: fix
回答6:
Maybe You have already added other Framework Search Path to Build setting,
Step 1: Remove all frame work search path in Build setting
Step 2: run Pod install
Step 3: Add others Framework search path (That's removed in step 1).
Now Run Project!
回答7:
Make sure that pod 'Firebase/Core'
is listed in your podfile; if Firebase/Core
is not listed, FirebaseAnalytics
will not be installed.
回答8:
Add FirebaseAnalytics.framework from Pods (project) > Pods > FirebaseAnalytics > Frameworks into your project target's Build Phases > Link Binary with Libraries.
Clean project, exit Xcode, wipe Derived Data, open Xcode and try again )
回答9:
Make sure your Xcode project is not being loaded by Xcode before the workspace. As a noob to CocoaPods and workspaces I did not realize that my workspace was not being loaded properly because it was still loaded in Xcode. If you can't drill into your project from the Workspace explorer window this is your problem.
To fix:
- Open Xcode.
- Close all projects and workspaces in Xcode.
- Close Xcode.
- Open the workspace file
Now you should be able to build the workspace properly.
来源:https://stackoverflow.com/questions/37717889/framework-not-found-firebaseanalytics