dyld: символ не найден: _OBJC_CLASS _ $ _ GTMMIMEDocument после перехода на Swift 4.2 и Firebase 5.8 - PullRequest
0 голосов
/ 19 сентября 2018

Это сложный вопрос.Я обновил 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

Я знаю, что это должно быть проблемой с путями поискаили конфигурация модуля, но я не могу найти решение.

Любые подсказки?

1 Ответ

0 голосов
/ 08 февраля 2019

Прошло много времени, так как мы исправили это и забыли поделиться решением.Глядя в хранилище, это кажется простым и очевидным.Но зачем это нужно, поскольку Swift 4.2 или Xcode 10.1 неясно.

Решение: добавьте это в файл pod: pod 'GTMSessionFetcher', '~> 1.2'

...