yandexmobile / yandex-ads-sdk-ios

Yandex Mobile Ads SDK iOS
https://yandex.com/dev/mobile-ads/
Other
37 stars 8 forks source link

При установке сразу же ошибка! Zip3Sequence #198

Closed Kabudasay closed 2 months ago

Kabudasay commented 4 months ago

Monosnap NskAdsSDK — Zip3 swift 2024-02-27 20-10-56

Вот под

platform :ios, '13.0' source 'https://github.com/CocoaPods/Specs.git'

pod 'GoogleAds-IMA-iOS-SDK', '~> 3.20.0' pod 'YandexMobileAds' pod 'YandexMobileAdsInstream'

deployment_target = '13.0'

post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target end end project.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target end end end

mobile-ads-github commented 4 months ago

Попробуйте выставить BUILD_LIBRARY_FOR_DISTRIBUTION=NO для DivKit. Примеры можно посмотреть в https://github.com/yandexmobile/yandex-ads-sdk-ios/issues/175 здесь и здесь.

mobile-ads-github commented 4 months ago

Спасибо за Ваше обращение, для разбора создана задача с номером PCODESUP-2978. Мы ознакомимся и вернемся с ответом в течение 2 дней, возможно запросим дополнительную информацию.

Thank you for your message, a task with the number PCODESUP-2978 has been created for analysis. We will get acquainted and return with the answer within 2 days, we may request additional information.

canitakeyourecode commented 4 months ago

https://github.com/yandexmobile/yandex-ads-sdk-ios/issues/198#issuecomment-1967252500

Указывал в под файле при установке не помогло

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'DivKit' # Убедитесь, что это правильное имя фреймворка
      target.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
      end
    end
  end
end

Даже если выставляю руками ни чего не меняется.

И тут такое дело у меня скрипт есть и я собираю свой SDK в framework

mobile-ads-github commented 4 months ago

Эта ошибка происходит не при компиляции DivKit, а при компиляции ее транзитивных зависимостей, а именно: VGSL_Fundamentals_tiny. Необходимо выключить BUILD_LIBRARY_FOR_DISTRIBUTION для его и зависимостей. В этом комментарии есть пример кода, который необходимо добавить.

Если интересует быстрый вариант, то

pod_targets_for_disable_build_for_distribution = [
     'VGSL_Fundamentals_tiny', # сюда необходимо будет добавлять имена тех библиотек, в которых появляется подобная ошибка
]

post_install do |installer|
     if target.name.start_with?(*pod_targets_for_disable_build_for_distribution)
        target.build_configurations.each do |config|
            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
        end
    end
end 
canitakeyourecode commented 4 months ago

Добавил в pod

pod_targets_for_disable_build_for_distribution = [
  'VGSLBaseTiny-framework',
  'VGSL_Fundamentals_tiny',
  'VGSL_Fundamentals_Tiny-framework',
  'VGSLBase-framework',
  'VGSL_Fundamentals-framework'
# сюда необходимо будет добавлять имена тех библиотек, в которых появляется подобная ошибка
]

post_install do |installer|
  installer.pods_project.targets.each do |target|

    if pod_targets_for_disable_build_for_distribution.include?(target.name)
      target.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
      end
    end
  end

  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
      end
    end

    project.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
    end

  end
end

Вот что ловлю:

ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found ld: warning: Could not find or use auto-linked framework 'MACAVPlayer': framework 'MACAVPlayer' not found ld: warning: Could not find or use auto-linked framework 'MACAnalytics': framework 'MACAnalytics' not found ld: warning: Could not find or use auto-linked framework 'MACBase': framework 'MACBase' not found ld: warning: Could not find or use auto-linked framework 'MACBaseUI': framework 'MACBaseUI' not found ld: warning: Could not find or use auto-linked framework 'MACCAChallengeHandler': framework 'MACCAChallengeHandler' not found ld: warning: Could not find or use auto-linked framework 'MACConsent': framework 'MACConsent' not found ld: warning: Could not find or use auto-linked framework 'MACConstants': framework 'MACConstants' not found ld: warning: Could not find or use auto-linked framework 'MACDependenciesUmbrella': framework 'MACDependenciesUmbrella' not found ld: warning: Could not find or use auto-linked framework 'MACDivKit': framework 'MACDivKit' not found ld: warning: Could not find or use auto-linked framework 'MACEncryption': framework 'MACEncryption' not found ld: warning: Could not find or use auto-linked framework 'MACEventTracking': framework 'MACEventTracking' not found ld: warning: Could not find or use auto-linked framework 'MACFalseClickKit': framework 'MACFalseClickKit' not found ld: warning: Could not find or use auto-linked framework 'MACFeatureFlags': framework 'MACFeatureFlags' not found ld: warning: Could not find or use auto-linked framework 'MACHeaderBidding': framework 'MACHeaderBidding' not found ld: warning: Could not find or use auto-linked framework 'MACLogging': framework 'MACLogging' not found ld: warning: Could not find or use auto-linked framework 'MACMediation': framework 'MACMediation' not found ld: warning: Could not find or use auto-linked framework 'MACMraid': framework 'MACMraid' not found ld: warning: Could not find or use auto-linked framework 'MACNative': framework 'MACNative' not found ld: warning: Could not find or use auto-linked framework 'MACNetworking': framework 'MACNetworking' not found ld: warning: Could not find or use auto-linked framework 'MACPlatformDescription': framework 'MACPlatformDescription' not found ld: warning: Could not find or use auto-linked framework 'MACSDKConfiguration': framework 'MACSDKConfiguration' not found ld: warning: Could not find or use auto-linked framework 'MACStoreKit': framework 'MACStoreKit' not found ld: warning: Could not find or use auto-linked framework 'MACTimeTracking': framework 'MACTimeTracking' not found ld: warning: Could not find or use auto-linked framework 'MACVASTKit': framework 'MACVASTKit' not found ld: warning: Could not find or use auto-linked framework 'MobileAdsCore': framework 'MobileAdsCore' not found ld: warning: Could not find or use auto-linked framework 'YandexMobileAds_Private': framework 'YandexMobileAds_Private' not found Undefined symbols for architecture arm64: "static LayoutKitInterface.UIElementPath.derived_struct_equals(LayoutKitInterface.UIElementPath, LayoutKitInterface.UIElementPath) -> Swift.Bool", referenced from: generic specialization <serialized, LayoutKitInterface.UIElementPath> of Swift.RawDictionaryStorage.find(_: A, hashValue: Swift.Int) -> (bucket: Swift._HashTable.Bucket, found: Swift.Bool) in YandexMobileAds[arm64]1238 generic specialization <serialized, LayoutKitInterface.UIElementPath> of Swift.RawDictionaryStorage.find(_: A, hashValue: Swift.Int) -> (bucket: Swift._HashTable.Bucket, found: Swift.Bool) in YandexMobileAds[arm64]1238 generic specialization <serialized, LayoutKitInterface.UIElementPath> of Swift.RawDictionaryStorage.find(_: A, hashValue: Swift.Int) -> (bucket: Swift._HashTable.Bucket, found: Swift.Bool) in YandexMobileAds[arm64]1238 "static LayoutKit.LayoutTrait.__derived_enum_equals(LayoutKit.LayoutTrait, LayoutKit.LayoutTrait) -> Swift.Bool", referenced from: static MACDivKit.AdDivCustomBlock.== infix(MACDivKit.AdDivCustomBlock, MACDivKit.AdDivCustomBlock) -> Swift.Bool in YandexMobileAds[arm64]1228 static MACDivKit.AdDivCustomBlock.== infix(MACDivKit.AdDivCustomBlock, MACDivKit.AdDivCustomBlock) -> Swift.Bool in YandexMobileAds[arm64]1228 protocol witness for static Swift.Equatable.== infix(A, A) -> Swift.Bool in conformance MACDivKit.AdDivCustomBlockHeight : Swift.Equatable in MACDivKit in YandexMobileAds[arm64]1231 "LayoutKit.LayoutTrait.Weight.default.unsafeMutableAddressor : LayoutKit.LayoutTrait.Weight", referenced from: MACDivKit.AdDivCustomBlock.weightOfVerticallyResizableBlock.getter : LayoutKit.LayoutTrait.Weight in YandexMobileAds[arm64]1228 MACDivKit.AdDivCustomBlockFactory.makeBlock(data: DivKit.DivCustomData, context: DivKit.DivBlockModelingContext) -> LayoutKit.Block in YandexMobileAds[arm64]1230 MACDivKit.AdDivMediaBlockProvider.customBlock(data: DivKit.DivCustomData, context: DivKit.DivBlockModelingContext) -> LayoutKit.Block in YandexMobileAds[arm64]1233 MACDivKit.AdDivMediaBlockProvider.(createAdDivMediaCustomBlockWithAspectRatio in _719DDAEF5CDAB47D91C118B7238F59F5)(adDivProperties: MACDivKit.AdDivProperties, data: [Swift.String : Any]) -> Swift.Result<MACDivKit.AdDivCustomBlock, MACDivKit.AdDivKitError> in YandexMobileAds[arm64]1233 MACDivKit.AdDivProgressBlockProvider.customBlock(data: DivKit.DivCustomData, context: DivKit.DivBlockModelingContext) -> LayoutKit.Block in YandexMobileAds[arm64]1235 "direct field offset for LayoutKit.UIActionEvent.uiAction : LayoutKitInterface.UserInterfaceAction", referenced from: MACDivKit.DivKitViewActionHandlerImpl.(handleTrackAnalyticsAction in _055E83C6B5895B09B47CD531265F9EF8)(event: LayoutKit.UIActionEvent, actionUrl: Foundation.URL) -> () in YandexMobileAds[arm64]1254 generic specialization of function signature specialization <Arg[1] = Existential To Protocol Constrained Generic> of MACDivKit.DivKitViewActionHandlerImpl.handle(event: LayoutKit.UIActionEvent, divKitView: MACDivKit.DivKitView) -> () in YandexMobileAds[arm64]1258 ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

canitakeyourecode commented 4 months ago

А это с чем связано ? Как я понимаю компилятор не может найти определения некоторых символов, используемых в коде

Kabudasay commented 4 months ago

?

Kabudasay commented 3 months ago

так а ответ будет ?

Kabudasay commented 3 months ago

А тут есть кто ?

mobile-ads-github commented 2 months ago

Попробуйте повторить ответ из этого комментария:

В Podfile необходимо указывать поды для тех таргетов, в которых их будете непосредственно использовать, а также:

Лучше всего иметь скрипт, который по имени пода будет собирать все его транзитивные зависимости - и уже для них отключать BUILD_LIBRARY_FOR_DISTRIBUTION, но как временное решение, можно указать все явно:

pod_targets_for_disable_build_for_distribution = [
  'DivKit',
  'DivKit_LayoutKit',
  'DivKit_LayoutKitInterface',
  'DivKit_Serialization',
  'VGSL_Fundamentals',
  'VGSL_Fundamentals_Tiny',
  'VGSLBase',
  'VGSLBaseTiny',
  'VGSLBaseUI',
  'VGSLCommonCore',
  'VGSLNetworking',
]
Kabudasay commented 2 months ago

не понимаю зачем мне явно указывать use_frameworks! :linkage => :static

Ну а pod_targets_for_disable_build_for_distribution это не сработает так как я просто тупо его выключал для всего, я ж скинул вам пример на github

mobile-ads-github commented 2 months ago

use_frameworks! :linkage => :static для удаления дублирования таргетов про проекте Pods вида: <target_name>-framework <target_name>-library.

Именно с этими изменениями ваш пример и был успешно собран.

Kabudasay commented 2 months ago

Так я после собираю в framework скриптом

mobile-ads-github commented 2 months ago

В чем разница сборки скриптом и через UI в Xcode?

Kabudasay commented 2 months ago

Разница в том что что я собираю fat либу

mobile-ads-github commented 2 months ago

Что включено в fat либу? Динамическая/статическая версия фрэймворка либо разные типы таргетов?

Kabudasay commented 2 months ago

не не я собираю под arm и x86

mobile-ads-github commented 2 months ago

По-итогу получилось ли собрать?