I have a project running on Xcode 12.3; it's in Objective-C and uses CocoaPods. The 3rd party libraries are built only for devices, not for simulators, so when I run my app on iPhone with iOS 13, the project builds successfully but I get the following error:
dyld: Symbol not found: _$s9SwiftGRPC17ServerSessionBaseC15initialMetadataAA0G0CvM
Referenced from: /private/var/containers/Bundle/Application/EE50CA2F-F5D6-4DF3-B76F-2E580D604C4B/####.app/Frameworks/Core.framework/Core
Expected in: /private/var/containers/Bundle/Application/EE50CA2F-F5D6-4DF3-B76F-2E580D604C4B/####.app/Frameworks/SwiftGRPC.framework/SwiftGRPC
in /private/var/containers/Bundle/Application/EE50CA2F-F5D6-4DF3-B76F-2E580D604C4B/####.app/Frameworks/Core.framework/Core
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)
The pod file is as below:
pod 'SwiftGRPC', '~> 0.9.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'CleverTap-iOS-SDK', '~> 3.7.1'
Why am I getting this error and how can I resolve it?
Have you tried setting BUILD_LIBRARY_FOR_DISTRIBUTION to true for all your frameworks to ensure module stability?
You'll need to set the flag to true in your app (under project settings) as well as in your dependencies by adding a post install script at the end of your Podfile.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
Original solution here
Related
I'm trying to use the new Stream iOS Chat SDK and am unable to get it to build after I install it via Cocoapods. The project was building with the other pods listed before we added StreamChat. I am using Xcode 10.2 (Does not work with 10.1), Swift 4.2, and Cocoapods version 1.7.4. We used the pod install command listed on Stream's website:
pod install --repo-update
Our Podfile looks like this:
platform :ios, '11.0'
inhibit_all_warnings!
target 'Project-iOS' do
use_frameworks!
# Pods for Project-iOS
pod 'ReachabilitySwift', '4.3.0'
pod 'SwiftKeychainWrapper', '3.2.0'
pod 'CropViewController'
pod 'StreamChat'
target 'Project-iOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'Project-iOSUITests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
*Note that I tried this with and without the post_install bit at the end - but was having to manually change the pods to 4.2 since for many 5.0 isn't supported yet.
These are the errors I'm seeing when I try and build:
Edit: I also tried to get this running in a new blank project with just the StreamChat pod targeting iOS 11 (Basically just as the instructions on the site state for the ChatDemo) and ran into the same type of issues.
Related to your first question be sure to use Xcode 10.2 or later and Swift 5.
No need force pods to Swift 4.2. Try to remove these lines from your Podfile, then your project should compile without any errors:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
When building the workspace throws a warning:
Target Pods - {AppName} product Pods_{AppName} cannot link framework Foundation.framework
This started after updating to Xcode 9.4. I updated CocoaPods to the latest version, v1.5.3, but it didn’t resolve the warning.
This is due to using the new build system in Xcode. The issue has not been resolved in the latest version of CocoaPods yet, v1.5.3 as of writing this.
For now, you can resolve the warning by adding this post_install action to your pod file:
post_install do |installer|
podsTargets = installer.pods_project.targets.find_all { |target| target.name.start_with?('Pods') }
podsTargets.each do |target|
target.frameworks_build_phase.clear
end
end
After updating your pod file run pod install again.
Source: CocoaPods: Cannot link framework Xcode warning
I have to migrate a project from Swift 2.3 to Swift 3. In this application there is also Objective C parts. So far I experienced several issues, but this one is really giving me a hard time: I updated all the Swift 3 libraries accordingly, and now I get an error in one library that is primarily being used in the Objective C part, which i don't know much of.
I run into this build issue:
ld: framework not found CocoaLumberjack
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is my pod file:
target 'SmartSpaces' do
xcodeproj 'SmartSpaces/SmartSpaces.xcodeproj'
pod 'CorePlot', :git => 'https://github.com/core-plot/core-plot.git'
pod 'Fingertips'
pod 'ReactiveCocoa', '~> 2.3.0'
pod 'CocoaLumberjack', '~> 2.0.2'
pod 'RestKit', '~> 0.26' end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.to_s == 'RestKit'
target.build_configurations.each do |config|
config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -framework "CocoaLumberjack"'
end
end
end
Does anybody know how this issue can be fixed?
I'm new to Unity iOS development and wanted to include a Google Play services in my Unity app. I've downloaded the Unity package (installed Cocoa, made sure my Pod file is set up correctly etc).
However, when I build my app I get GoogleSignIn/GIDSignIn.h file not found.
So far I've tried:
Installing 'Google/SignIn' using Cocoa (throws an invalid name
exception that)
Linking the GoogleSignIn bundle through Xcode linked
libraries (makes no difference)
Upgrading all packages (same as in Google/Signin) Adding
$(inherited) to linker flags (no change)
checking FrameWork Search path,Header Search path
Pods file:
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'GooglePlayGames', '~> 5.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end end end
I go through this links:
“GooglePlus/GooglePlus.h file not found” when trying to build my project
https://github.com/playgameservices/play-games-plugin-for-unity/issues/1526
https://github.com/playgameservices/play-games-plugin-for-unity/issues/1460
Change the pod file from below and again install the pod
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'GooglePlayGames', '~> 5.0'
pod 'Google/SignIn'
end
The iOS app worked fine before adding Firebase/Messaging, but after adding it and running 'pod update' I started getting these errors when building:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GTMLogger", referenced from:
objc-class-ref in FirebaseMessaging(GIPReachability_d54098c5c1e1fdc4fca31a4803478650.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my current Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'KarmaSous' do
pod 'Firebase'
pod 'FirebaseMessaging'
pod 'Firebase/Database'
pod 'Kingfisher', '~> 3.1.4'
pod "GMStepper"
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Any help would be greatly appreciated, thank you!
Have you tried adding pod 'Firebase/Messaging' instead of pod 'FirebaseMessaging'?
I had same error, and I have solved the error.
Please make sure that "Edit Scheme > Build > Build Options > Find Implicit Dependencies" is checked.