Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol not found #2

Open
ChristianMoler opened this issue Jun 9, 2022 · 9 comments
Open

Symbol not found #2

ChristianMoler opened this issue Jun 9, 2022 · 9 comments

Comments

@ChristianMoler
Copy link

ChristianMoler commented Jun 9, 2022

На последней версии и ранних получаю краш на запуске.

dyld[2904]: Symbol not found: ZN5swift34swift50override_conformsToProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEPFPKNS_18TargetWitnessTableIS1_EES4_S8_E
Referenced from: /private/var/containers/Bundle/Application/B5062C0E-E262-4A4C-ADB5-EFBD34C1767C/
/Frameworks/JivoSDK.framework/JivoSDK
Expected in: /private/var/containers/Bundle/Application/B5062C0E-E262-4A4C-ADB5-EFBD34C1767C/
/Frameworks/CollectionAndTableViewCompatible.framework/CollectionAndTableViewCompatible
Symbol not found: ZN5swift34swift50override_conformsToProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEPFPKNS_18TargetWitnessTableIS1_EES4_S8_E
Referenced from: /private/var/containers/Bundle/Application/B5062C0E-E262-4A4C-ADB5-EFBD34C1767C/
/Frameworks/JivoSDK.framework/JivoSDK
Expected in: /private/var/containers/Bundle/Application/B5062C0E-E262-4A4C-ADB5-EFBD34C1767C/
____/Frameworks/CollectionAndTableViewCompatible.framework/CollectionAndTableViewCompatible
(lldb)

На версии 1.7 было нормально

@bronenos
Copy link
Collaborator

bronenos commented Jul 1, 2022

Под какую архитектуру возникает такая проблема?

@4tune
Copy link

4tune commented Sep 20, 2022

Та же ошибка. Собираем под iPhone. Версия 2.1.3

@ChristianMoler
Copy link
Author

ChristianMoler commented Sep 27, 2022

  • Xcode 14.0
  • v2.1.3
  • iPhone & simulator

Ошибка сохраняется

bronenos added a commit that referenced this issue Nov 10, 2022
@AndrewNes
Copy link

AndrewNes commented Nov 28, 2022

Идентичная проблема:

  • xCode Version 14.0.1 (14A400)
  • v3.0.0

@bronenos
Copy link
Collaborator

Оказалось затруднительно диагностировать проблему, учитывая что она проявляется не у всех. Но самая первая рекомендация: удостовериться, что у всех зависимостей проекта проставлен флаг BUILD_LIBRARY_FOR_DISTRIBUTION=YES.

@AbdulahadTursunov
Copy link

проблема до сих пор есть
xcode 14.2
v3.0.0

флаг BUILD_LIBRARY_FOR_DISTRIBUTION = true включен

@AndrewNes
Copy link

AndrewNes commented Jan 19, 2023

У меня данная проблема, проявляется именно в React-Native проектах. И добавление одного флага BUILD_LIBRARY_FOR_DISTRIBUTION = true для меня оказалось недостаточно. Но у меня сработало данное решение в Podfile:

def getBuildLibrariesForDistribution(installer)
     juvoLibName = [
      "BABFrameObservingInputAccessoryView", "CollectionAndTableViewCompatible", "DTCollectionViewManager",
      "DTModelStorage", "GzipSwift", "JFEmojiPicker", "JFMarkdownKit", "JFWebSocket", "JMCodingKit",
      "JMDesignKit", "JMImageLoader", "JMMarkdownKit", "JMOnetimeCalculator", "JMRepicKit", "JMScalableView",
      "JMShared", "JMSidePanelKit", "JMTimelineKit", "KeychainSwift", "ObjcExceptionBridging", "PureParser",
      "ReachabilitySwift", "Realm", "RealmSwift", "SafeURL", "SwiftGraylog", "SwiftMime", "SwiftyNSException",
      "TypedTextAttributes", "XCGLogger", "SwiftDate", "libPhoneNumber-iOS"
     ]
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
         if (juvoLibName.include? target.to_s)
             config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
          end
        end
    end
  end

Где функция getBuildLibrariesForDistribution(installer) добавлена в тело post_install do |installer|

Да, решение не из самых лучших, но у меня работает.

@bronenos
Copy link
Collaborator

На основании решения @AndrewNes сформировали вариант ниже.
Попробуйте, пожалуйста.

Про настройки IPHONEOS_DEPLOYMENT_TARGET и GENERATE_INFOPLIST_FILE пока еще не удалось понять однозначно, как они должны выглядеть (или же каждому проекту индивидуальный подход), и потому возможно с ними еще доведётся поиграться.

Но вместо указания кучи библиотек, вот этот скрипт должен сам сканировать и находить нужные. А мы тем временем работаем над вариантом Open Source вместо раздачи в виде framework, поэтому такие проблемы в последствии должны попросту исчезнуть.

post_install do |installer|
  JivoPatcher.new(installer).patch()
end

class JivoPatcher
  def initialize(installer)
    @sdkname = "JivoSDK"
    @installer = installer
  end
  
  def patch()
    libnames = collectLibNames()
    
    @installer.pods_project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      
      target.build_configurations.each do |config|
        if libnames.include? target.to_s
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
          config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
        end
      end
    end
  end
  
  private def collectLibNames()
    depnames = Array.new
    
    @installer.pod_targets.each do |target|
      next if target.to_s != @sdkname
      depnames = collectTargetLibNames(target)
    end
    
    return depnames.uniq()
  end

  private def collectTargetLibNames(target)
    depnames = [target.to_s]
    
    target.dependent_targets.each do |subtarget|
      depnames += [subtarget.to_s] + collectTargetLibNames(subtarget)
    end
    
    return depnames
  end
end

@AndrewNes
Copy link

В xCode 15, возможно придется брать строчку "config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants