I'm trying to use the new(?) CocoaPods subspec for Parse's FacebookUtils framework.
The readme for the pod says:
If you wish to use the Facebook or Twitter utils or ParseUI, you can
now leverage Cocoapods 'subspecs'
ruby
pod 'Parse/FacebookUtils'
pod 'Parse/TwitterUtils'
pod 'Parse/UI'
Note that in this case, the Parse framework will contain all headers
and classes, so you just have to use:
swift import Parse
objc #import Parse;
And importing the main Parse classes works this way. However, the subspecs FacebookUtils and UI are not recognized by the Xcode compiler!
It simply says "PFFacebookUtils" is an undeclared identifier.
Note: I am using use_frameworks! at the top of the podfile which results in Pods_PROJECT.framework in my "Link Binary With Libraries" list.
I'm kind of lost here and would really appreciate some help.
UPDATE:
I figured out that the issue seems to be my podfile section for an iMessage extension:
target 'MyApp' do
pod 'Parse/UI'
pod 'Parse/FacebookUtils'
end
target 'iMessage App' do
pod 'Parse/Core'
end
Somehow this results in a successful compilation, but a crash on startup with the error:
dyld: Symbol not found: _OBJC_CLASS_$_PFFacebookUtils
Referenced from: .../myapp.app/myapp
Expected in: .../MyApp/Frameworks/Parse.framework/Parse
When adding the FacebookUtils subspec to the iMessage extension, the crash goes away and all is well... except FacebookUtils contains references (UIApplication) that are not allowed in extensions. >:U
The crash is caused by CocoaPods script Pods-YourProject-frameworks.sh installing Parse-Core-FacebookUtils-TwitterUtils/Parse.framework and Parse-Core/Parse.framework to the exact same location, effectively overwriting the former
install_framework "${BUILT_PRODUCTS_DIR}/Parse-Core-FacebookUtils-TwitterUtils/Parse.framework"
install_framework "${BUILT_PRODUCTS_DIR}/Parse-Core/Parse.framework"
I solved it by adding the following run script before CocoaPods run script
/usr/bin/sed -i '' '/Parse-Core\/Parse.framework/d' "${PODS_ROOT}/Target Support Files/Pods-YourProjectName/Pods-YourProjectName-frameworks.sh"
This removes the offending lines from CocoaPods script and solves the crash.
Note: remove -Core part that if you use pod 'Parse' instead of pod 'Parse/Core'.
Related
I'm building a Flutter Plugin for a native only available SDK . When it comes to the swift part, I've specified the pod in the .podspec file and now when I try to pod install in the Plugin's example app , I'm getting the above error . If the use_frameworks! is commented in the example app's Podfile , The error disappears but when present the error again arises.Also the same error does not come when putting the pod in the Podfile of the example app even with use_frameworks! directive. But I need to install it through the Plugin's .podspec file. I've also tried using s.static_framework=true and it works but an another error arises which is 'Include of non-modular header inside the framework module(Users/../LibraryA/LibraryA.framework/Headers/Xyz.h)' and couldn't solve this issue too.
What does the error exactly mean? Does it mean that the pod I'm trying to install is itself a static library or does it contain any static libraries as dependency?
Also why it gets installed when trying to install the pod in the Podfile with use_frameworks! but not in the .podspec file?
What are the ways through which I can fix this issue?
I got this error when I ran my app on my phone
enter image description here
When I want to add the missing dynamic library, I find that the library is grayish white. Are all the libraries imported through pod like this? It means that the library is missing. I'm looking forward to your help
enter image description here
Normally you don't have to add the frameworks you installed from your podfile via pod install manually. They are all contained in the Pods framework (in your case Pods_ZSS.framework) and added to your project automatically.
Xcode now tries to add Alamofire.framework a second time and does not find the corresponding header search paths, etc. or does not know, which framework should be used.
Try the following:
Remove the additional import of Alamofire, clean build folder and build again.
If the error still occurs, close Xcode and run pod install via terminal in your project folder. This configures your Pods project and adds the dependencies to your main project for you.
Also check, if the target define in your podfile exactly matches the name of your target in Xcode. E.g. your target in Xcode is named 'SSZ', then your podfile should look something like this:
platform :ios, '<your_target_deployment_version>'
# Imports for target 'SSZ'
target 'SSZ' do
# Use dynamic frameworks
use_frameworks!
# Frameworks
pod 'Alamofire', '<specified_framework_version>'
pod '<second_framework>', '<specified_framework_version>'
pod '<third_framework>', '<specified_framework_version>'
# so on and on
end
Also remember to open the project's workspace generated after running pod install (<project_name>.xcworkspace). Otherwise Xcode will not build and integrate your frameworks when building your app. <project_name>.xcodeproj just contains your own project without the frameworks.
Xcode starts encountering this error
ld: framework not found Firebase-XXXXXX
where XXXXXX would be any framework listed in the podfile, here is the specific part of that podfile
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI/Database'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
after I update the existing project's firebase frameworks (which were in 4.x.x version at the time of starting this project) to the newer 5.x.x version of firebase (for using ML-Kit) using pod install in the project directory, it fails to compile it.
Steps taken so far after going through the web,
The following is done with a backed copy of running 4.x.x version of project,
a) Tried all answers from this green ticked question
b) Cleared Xcode's Derived data for this project, cocoapods cache uninstalled/ reinstalling it entirely. Commented out firebase part in podfile and then pod install it twice (one for removing the firebase and second for installing it again)
c) Manually copying the error generating firebase dependancies to the project's folder (bad idea, 52 bugs 300+ warnings)
Help will be highly appreciated.
Add the following to the Podfile:
pod 'FirebaseAnalytics'
In Firebase 5, FirebaseAnalytics is no longer an implicit dependency of Database, Messaging, and Storage.
The Firebase docs recommend always including FirebaseAnalytics to include Analytics.
Every Firebase dependancies has various linkages between them, even if your project doesn't need, For instance -- for this dependency: ld: framework not found FirebaseDatabaseUI was not required in the project and was taken out by these steps,
Goto
Target(project_name)-> Build Settings-> search(Other linker flags)-> from
their remove the conflicting dependency
Be sure to build back and check if that dependency was even been used or not, in my case it wasn't.
I'm trying to integrate Localytics into my iOS app and am using cocoapods:
pod 'Localytics'
However, when I start my app (I'm not even invoking or importing the Localytics namespace yet) my app blows up with this error:
dyld: Library not loaded: #rpath/Localytics.framework/Localytics
Referenced from: /Users/bobbydavro/Library/Developer/CoreSimulator/Devices/8A21B45E-D77B-41F7-AB45-8F77DE48A4AF/data/Containers/Bundle/Application/556E667A-59D9-4072-81F1-B9CA600E0C46/MyApp.app/MyApp
Reason: image not found
I've found a number of related SO articles on this but none of the suggested fixes work:
make the linked pods binary 'optional'
disable bitcode
pod deintegrate, then re-install
I'm stuck, I also tried using Segment to integrate but it has a direct dependency on the same pod and blows up exactly the same way :/
Well, try the following:
go to Project Setting Your_Target -> General -> Embedded Binaries -> click on + button and add your library here
To use the dynamic framework with Cocoapods 1.0, you need to add the use_frameworks! statement to your Podfile.
platform :ios, '8.0'
target 'MyApp' do
use_frameworks!
pod 'Localytics'
end
This was happening to me as well. For some reason, my project didn't like their dynamic framework. (I'm not supporting iOS 7 so that shouldn't be an issue.)
My fix was to use their static framework.
pod 'LocalyticsStaticFramework'
It's likely an issue with the project settings, not their framework.
Every time I open my XCode project in XCode 7.1.1, I get the error: "No such module Parse" wherever I import Parse.
However, I have the Parse framework correctly added in my Build Phases, and the only way to fix this is by deleting the Parse framework listed in my Build Phases and re-adding it like I did the first time.
I have to do this every time I reopen an XCode project, and it's extremely annoying, but able to be worked around. Does anyone have any permanent fixes for this?
Thank you!
I suggest using CocoaPods to install Parse for Swift using the following Podfile:
platform :ios, "8.0"
use_frameworks!
pod 'Parse'
Parse can then be installed with
pod install