1

That's a hard one. I updated Firebase from 3.x to 5.8 and migrated my project from Swift 3 to Swift 4.2. Now I'm getting the following error:

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

I've tried pod deintegrate and pod install without success.

But that's not all. The project is quite large and complex. For example we have a share extension using Firebase/Core, Firebase/Auth and Firebase/Database.

Here's the 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!

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

I know it must be an issue with the search paths or module configuration but I can't figure out a solution.

Any clues?

4

1 回答 1

1

It's been a while, since we fixed it and forgot to share the solution. Looking into the repository it seems easy and obvious. But why it's needed since Swift 4.2 or Xcode 10.1 is not clear.

Solution: Add this to your pod file: pod 'GTMSessionFetcher', '~> 1.2'

于 2019-02-08T10:02:08.650 回答