dyld:未找到符号:迁移到 Swift 4.2 和 Firebase 5.8 后的 _OBJC_CLASS_$_GTMMIMEDocument
dyld: Symbol not found: _OBJC_CLASS_$_GTMMIMEDocument after migrating to Swift 4.2 and Firebase 5.8
这很难。
我将 Firebase 从 3.x 更新到 5.8,并将我的项目从 Swift 3 迁移到 Swift 4.2。
现在我收到以下错误:
dyld: Symbol not found: _OBJC_CLASS_$_GTMMIMEDocument
Referenced from: /Users/jarosz/Library/Developer/CoreSimulator/Devices/102264AE-4116-4108-B004-CAE6A422DF01/data/Containers/Bundle/Application/2E200B33-7FE4-4421-856E-3C1FE78A17B6/StarSnoopy DEV.app/Frameworks/GoogleAPIClientForREST.framework/GoogleAPIClientForREST
Expected in: /Users/jarosz/Library/Developer/CoreSimulator/Devices/102264AE-4116-4108-B004-CAE6A422DF01/data/Containers/Bundle/Application/2E200B33-7FE4-4421-856E-3C1FE78A17B6/StarSnoopy DEV.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher
in /Users/jarosz/Library/Developer/CoreSimulator/Devices/102264AE-4116-4108-B004-CAE6A422DF01/data/Containers/Bundle/Application/2E200B33-7FE4-4421-856E-3C1FE78A17B6/StarSnoopy DEV.app/Frameworks/GoogleAPIClientForREST.framework/GoogleAPIClientForREST
我试过 pod deintegrate
和 pod install
都没有成功。
但这还不是全部。该项目相当庞大和复杂。例如,我们有一个使用 Firebase/Core、Firebase/Auth 和 Firebase/Database 的共享扩展。
这是播客文件:
# 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!
source 'https://github.com/CocoaPods/Specs.git'
source 'https://www.x-root.info/gitlab/x-root/ios-libraries/xr-podspecs.git'
# ------------------ APP ------------------
def app_pods
# Objc
pod 'HockeySDK', '~> 5.1.2'
pod 'SVProgressHUD', '~> 2.2.5'
pod 'SDWebImage', '~> 4.4.2'
pod 'TSMessages', '~> 0.9.12'
pod 'MMDrawerController', '~> 0.6.0'
pod 'iRate', '~> 1.12.2'
#Swift
pod 'SwiftyJSON', '~> 4.1.0'
pod 'ReachabilitySwift', '~> 4.2.1'
pod 'SwiftyUserDefaults', '~> 3.0.1'
pod 'XRCore', '~> 4.2.0'
pod 'FBSDKCoreKit', '= 4.36.0'
pod 'FBSDKLoginKit', '= 4.36.0'
pod 'Firebase/Core', '~> 5.8.0'
pod 'Firebase/Auth', '~> 5.8.0'
pod 'Firebase/Database', '~> 5.8.0'
pod 'Firebase/Storage', '~> 5.8.0'
pod 'Firebase/DynamicLinks', '~> 5.8.0'
pod 'Firebase/Invites', '~> 5.8.0'
pod 'Firebase/RemoteConfig', '~> 5.8.0'
pod 'GoogleSignIn', '~> 4.2.0'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
pod 'KeychainAccess', '~> 3.1.1'
pod 'TTGSnackbar', '~> 1.7.3'
pod 'UIImageColors', '~> 2.0.1'
pod 'MarqueeLabel/Swift', '~> 3.1.6'
pod 'MTBBarcodeScanner', '~> 5.0.6'
pod 'TGCameraViewController', '~> 2.2.8'
pod 'MaterialComponents/FeatureHighlight', '~> 26.0'
pod 'IQKeyboardManagerSwift', '~> 4.0.13'
end
post_install do | installer |
require 'fileutils'
FileUtils.cp_r('Pods/Target Support Files/Pods-MyApp DEV/Pods-MyApp DEV-acknowledgements.plist', 'Wishlist/Settings.bundle/Acknowledgements.plist', :remove_destination => true)
# avoid usage of UIApplication by GTMSessionFetcher in share extension
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) GTM_BACKGROUND_UIAPPLICATION=0 $(inherited) GTM_BACKGROUND_TASK_FETCHING=0'
end
end
end
target 'MyApp DEV' do
app_pods
end
target 'MyApp' do
app_pods
end
# ------------------ EXTENSION ------------------
def sharing_pods
# Objc
pod 'SDWebImage', '~> 4.4.2'
#Swift
pod 'SwiftyJSON', '~> 4.1.0'
pod 'SwiftyUserDefaults', '~> 3.0.1'
pod 'XRCore/Extension', '~> 4.2.0'
pod 'Firebase/Core', '~> 5.8.0'
pod 'Firebase/Auth', '~> 5.8.0'
pod 'Firebase/Database', '~> 5.8.0'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
pod 'KeychainAccess', '~> 3.1.1'
end
target 'Sharing DEV' do
sharing_pods
end
target 'Sharing' do
sharing_pods
end
class ::Pod::Generator::Acknowledgements
def header_text
if header_title.end_with?("Acknowledgements")
"This app is using Open Source components which are provided under the following Open Source licence terms of the respective rights holder."
else
""
end
end
end
我知道这一定是搜索路径或模块配置的问题,但我想不出解决办法。
有什么线索吗?
已经有一段时间了,因为我们修复了它而忘记分享解决方案。查看存储库似乎简单明了。但是为什么需要它,因为 Swift 4.2 或 Xcode 10.1 尚不清楚。
解决方法:
将此添加到您的 pod 文件中:
pod 'GTMSessionFetcher', '~> 1.2'
这很难。 我将 Firebase 从 3.x 更新到 5.8,并将我的项目从 Swift 3 迁移到 Swift 4.2。 现在我收到以下错误:
dyld: Symbol not found: _OBJC_CLASS_$_GTMMIMEDocument
Referenced from: /Users/jarosz/Library/Developer/CoreSimulator/Devices/102264AE-4116-4108-B004-CAE6A422DF01/data/Containers/Bundle/Application/2E200B33-7FE4-4421-856E-3C1FE78A17B6/StarSnoopy DEV.app/Frameworks/GoogleAPIClientForREST.framework/GoogleAPIClientForREST
Expected in: /Users/jarosz/Library/Developer/CoreSimulator/Devices/102264AE-4116-4108-B004-CAE6A422DF01/data/Containers/Bundle/Application/2E200B33-7FE4-4421-856E-3C1FE78A17B6/StarSnoopy DEV.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher
in /Users/jarosz/Library/Developer/CoreSimulator/Devices/102264AE-4116-4108-B004-CAE6A422DF01/data/Containers/Bundle/Application/2E200B33-7FE4-4421-856E-3C1FE78A17B6/StarSnoopy DEV.app/Frameworks/GoogleAPIClientForREST.framework/GoogleAPIClientForREST
我试过 pod deintegrate
和 pod install
都没有成功。
但这还不是全部。该项目相当庞大和复杂。例如,我们有一个使用 Firebase/Core、Firebase/Auth 和 Firebase/Database 的共享扩展。
这是播客文件:
# 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!
source 'https://github.com/CocoaPods/Specs.git'
source 'https://www.x-root.info/gitlab/x-root/ios-libraries/xr-podspecs.git'
# ------------------ APP ------------------
def app_pods
# Objc
pod 'HockeySDK', '~> 5.1.2'
pod 'SVProgressHUD', '~> 2.2.5'
pod 'SDWebImage', '~> 4.4.2'
pod 'TSMessages', '~> 0.9.12'
pod 'MMDrawerController', '~> 0.6.0'
pod 'iRate', '~> 1.12.2'
#Swift
pod 'SwiftyJSON', '~> 4.1.0'
pod 'ReachabilitySwift', '~> 4.2.1'
pod 'SwiftyUserDefaults', '~> 3.0.1'
pod 'XRCore', '~> 4.2.0'
pod 'FBSDKCoreKit', '= 4.36.0'
pod 'FBSDKLoginKit', '= 4.36.0'
pod 'Firebase/Core', '~> 5.8.0'
pod 'Firebase/Auth', '~> 5.8.0'
pod 'Firebase/Database', '~> 5.8.0'
pod 'Firebase/Storage', '~> 5.8.0'
pod 'Firebase/DynamicLinks', '~> 5.8.0'
pod 'Firebase/Invites', '~> 5.8.0'
pod 'Firebase/RemoteConfig', '~> 5.8.0'
pod 'GoogleSignIn', '~> 4.2.0'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
pod 'KeychainAccess', '~> 3.1.1'
pod 'TTGSnackbar', '~> 1.7.3'
pod 'UIImageColors', '~> 2.0.1'
pod 'MarqueeLabel/Swift', '~> 3.1.6'
pod 'MTBBarcodeScanner', '~> 5.0.6'
pod 'TGCameraViewController', '~> 2.2.8'
pod 'MaterialComponents/FeatureHighlight', '~> 26.0'
pod 'IQKeyboardManagerSwift', '~> 4.0.13'
end
post_install do | installer |
require 'fileutils'
FileUtils.cp_r('Pods/Target Support Files/Pods-MyApp DEV/Pods-MyApp DEV-acknowledgements.plist', 'Wishlist/Settings.bundle/Acknowledgements.plist', :remove_destination => true)
# avoid usage of UIApplication by GTMSessionFetcher in share extension
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) GTM_BACKGROUND_UIAPPLICATION=0 $(inherited) GTM_BACKGROUND_TASK_FETCHING=0'
end
end
end
target 'MyApp DEV' do
app_pods
end
target 'MyApp' do
app_pods
end
# ------------------ EXTENSION ------------------
def sharing_pods
# Objc
pod 'SDWebImage', '~> 4.4.2'
#Swift
pod 'SwiftyJSON', '~> 4.1.0'
pod 'SwiftyUserDefaults', '~> 3.0.1'
pod 'XRCore/Extension', '~> 4.2.0'
pod 'Firebase/Core', '~> 5.8.0'
pod 'Firebase/Auth', '~> 5.8.0'
pod 'Firebase/Database', '~> 5.8.0'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
pod 'KeychainAccess', '~> 3.1.1'
end
target 'Sharing DEV' do
sharing_pods
end
target 'Sharing' do
sharing_pods
end
class ::Pod::Generator::Acknowledgements
def header_text
if header_title.end_with?("Acknowledgements")
"This app is using Open Source components which are provided under the following Open Source licence terms of the respective rights holder."
else
""
end
end
end
我知道这一定是搜索路径或模块配置的问题,但我想不出解决办法。
有什么线索吗?
已经有一段时间了,因为我们修复了它而忘记分享解决方案。查看存储库似乎简单明了。但是为什么需要它,因为 Swift 4.2 或 Xcode 10.1 尚不清楚。
解决方法:
将此添加到您的 pod 文件中:
pod 'GTMSessionFetcher', '~> 1.2'