yandexmobile / yandex-ads-flutter-plugin

Flutter plugin for Yandex Mobile Ads SDK. This plugin allows Flutter developers to easily integrate Yandex Mobile Ads SDK on Android and iOS apps.
Other
11 stars 2 forks source link

Target has transitive dependencies that include statically linked binaries #30

Open asg1997 opened 5 months ago

asg1997 commented 5 months ago

Добрый день, столкнулась с ошибкой при интеграции sdk со стороны ios.

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/maksim/Desktop/разработка/neuro_astro/ios/Pods/YandexMobileAds/static/YandexMobileAds.xcframework)

# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do

  use_frameworks!
  use_modular_headers!

  pod 'YandexMobileAds', '~> 6.4.0'

  # для ускорения работы FirebaseFirestore
  pod 'FirebaseFirestore',
    :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git',
    :tag => '10.22.0'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end
flutter doctor -v [✓] Flutter (Channel stable, 3.19.4, on macOS 14.2.1 23C71 darwin-x64, locale ru-RU) • Flutter version 3.19.4 on channel stable at /Users/maksim/Documents/Flutter_SDK/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 68bfaea224 (7 days ago), 2024-03-20 15:36:31 -0700 • Engine revision a5c24f538d • Dart version 3.3.2 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/maksim/Library/Android/sdk • Platform android-34, build-tools 33.0.0 • ANDROID_HOME = /Users/maksim/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15A507 • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) [✓] VS Code (version 1.87.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.84.0 [✓] Connected device (4 available) • Яна (mobile) • 00008130-001864193CD8001C • ios • iOS 17.3.1 21D61 • Ангелина (mobile) • 00008110-001C1DC60E03801E • ios • iOS 17.4.1 21E236 • macOS (desktop) • macos • darwin-x64 • macOS 14.2.1 23C71 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87 [✓] Network resources • All expected network resources are available. • No issues found!
mobile-ads-github commented 5 months ago

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

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

ekinsdrow commented 5 months ago

Добрый день, так же столкнулся с этой же проблемой при попытке сделать pod install или arch -x86_64 pod install Прилетает такая же ошибка

Запускаю на mac с arm

ekinsdrow commented 5 months ago

Получилось победить изменив строчку с use_frameworks! в podfile проекта на use_frameworks! :linkage => :static

image

@asg1997 FYI

UPD - перестал работать pod install, пришлось решать как тут - https://github.com/yandexmobile/yandex-ads-flutter-plugin/issues/17 через изменение зависимости в '.symlink'

dmitriyap11 commented 5 months ago

Ещё один вариант обхода проблемы:

...

target 'Runner' do
 ...
end

# Fix:
# [!] The 'Pods-Runner' target has transitive dependencies
# that include statically linked binaries: (.. /ios/Pods/YandexMobileAds/static/YandexMobileAds.xcframework)
static_frameworks = ['YandexMobileAds', 'yandex_mobileads']
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if static_frameworks.include?(pod.name)
      def pod.static_framework?;
        true
      end
      def pod.build_type;
        Pod::BuildType.static_library
      end
    end
  end
end

...

В этом случае BuildType.static_library используется только у указанных пакетов:YandexMobileAds и yandex_mobileads.

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

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

@mobile-ads-github , 3 недели прошло. Коллеги, планируется ли какое-то решение?

vanyasem commented 1 month ago

@mobile-ads-github проблема всё ещё актуальна в версии 7.2.0