Coder Social home page Coder Social logo

Comments (5)

kanstantsin avatar kanstantsin commented on July 18, 2024 2

Вышла сборка YandexMobileAds динамическим фреймворком. Можно пробовать s.dependency 'YandexMobileAds/Dynamic'. Если будут проблемы, просьба переоткрыть Issue.

from yandex-ads-sdk-ios.

kanstantsin avatar kanstantsin commented on July 18, 2024

В ближайших планах есть поддержка дистрибуции в качестве динамического фреймворка, мы работаем над этим.

from yandex-ads-sdk-ios.

HiveHicks avatar HiveHicks commented on July 18, 2024

В качестве временного решения я вручную сбилдил динамический фрэймворк YandexMobileAds и подключил его как локальный под. Podspec пода:

Pod::Spec.new do |s|
  s.name = "YandexMobileAds"
  s.version = "2.5.0"
  s.summary = "The Yandex Mobile Ads SDK provides mobile interfaces for Yandex Advertising Network" 

  s.homepage = "https://tech.yandex.ru/mobile-ads/"
  s.license = { :type => 'PROPRIETARY', :file => 'LICENSE.txt' }
  s.authors = { "Andrey Shender" => "[email protected]", "Kanstantsin Charnukha" => "[email protected]" }
  s.platform = :ios, '6.0'
  s.source = { :git => "https://github.com/yandexmobile/yandex-ads-sdk-ios.git", :tag => s.version.to_s}

  s.ios.vendored_frameworks = 'YandexMobileAds.framework'

  s.libraries = 'xml2'

  s.dependency 'YandexMobileMetrica', '>= 2.5.1', '< 3.0.0'
  s.frameworks = 'UIKit', 'Foundation', 'CoreTelephony', 'CoreLocation', 'CoreGraphics', 'CoreTelephony', 'AdSupport'
  s.weak_frameworks = 'SafariServices'

  s.requires_arc = true
end

Чтобы компилятор не ругался на импорты, также пришлось добавить в podfile основного проекта пост-инсталл хук:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "MyPodThatDependsOnYandexMobileAds"
            target.build_configurations.each do |config|
                config.build_settings['FRAMEWORK_SEARCH_PATHS'] = '$(inherited) "${PROJECT_DIR}/../../YandexMobileAds"'
            end
        end
    end
end

pod install и компиляция проходят успешно, однако при запуске приложения выдается рантайм ошибка о том, что не найден фреймворк YandexMobileMetrica.

dyld: Library not loaded: @rpath/YandexMobileMetrica.framework/YandexMobileMetrica
  Referenced from: /Users/user/Library/Developer/CoreSimulator/Devices/3427651F-8BAB-4D05-98C4-A605DEE264E5/data/Containers/Bundle/Application/D6EB8CE9-4D4A-44AD-8E98-0C7B1F0CA3D6/MyApp.app/Frameworks/YandexMobileAds.framework/YandexMobileAds
  Reason: image not found

Если просмотреть содержимое package приложения, то его там действительно нет.

При этом если на данном этапе добавить YandexMobileMetrica как embedded framework в основное приложение, в рантайме возникает куча новых ошибок про дублирующиеся символы:

objc[69366]: Class PodYandexMobileMetrica_PodsDummy_YXStartupParameters is implemented in both /Users/user/Library/Developer/CoreSimulator/Devices/3427651F-8BAB-4D05-98C4-A605DEE264E5/data/Containers/Bundle/Application/32F9AAB4-7ECF-4FAA-8357-0CF5B0810354/MyApp.app/Frameworks/YandexMobileMetrica.framework/YandexMobileMetrica (0x1221b49b0) and /Users/user/Library/Developer/CoreSimulator/Devices/3427651F-8BAB-4D05-98C4-A605DEE264E5/data/Containers/Bundle/Application/32F9AAB4-7ECF-4FAA-8357-0CF5B0810354/MyApp.app/MyApp (0x10c5ece10). One of the two will be used. Which one is undefined.

Может быть, у вас есть какие-то идеи относительно того, как это победить и нормально настроить зависимости?

from yandex-ads-sdk-ios.

bamx23 avatar bamx23 commented on July 18, 2024

Для решения проблемы из первого сообщения можно попробовать что-то такое:

pre_install do |installer|
    def installer.verify_no_static_framework_transitive_dependencies; end
end

Однако проблема дублирования в рантайме может сохраниться.
Попробуйте в Вашей кастомной спеке указать динамический фреймворк AppMetrica:

s.dependency 'YandexMobileMetrica/Dynamic', '>= 2.6.5', '< 3.0.0'

И можно подробнее, как Вы собрали динамический фреймворк из статической библиотеки?

from yandex-ads-sdk-ios.

HiveHicks avatar HiveHicks commented on July 18, 2024

Указание динамической версии YandexMobileMetrica помогло.

Фрэймворк собирал вторым методом, описанным здесь: https://pewpewthespells.com/blog/convert_static_to_dynamic.html. Любопытно, что я Яндексом это сработало, а с GoogleMobileAds — нет, все так же ругается на transitive dependencies that include static binaries.

from yandex-ads-sdk-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.