yoomoney / yookassa-payments-swift

This library allows implementing payment acceptance into mobile apps on iOS and works as an extension to the YooMoney API
https://yookassa.ru/developers
MIT License
41 stars 41 forks source link

Failed to build module 'MoneyAuth' - ошибка версии Swift #87

Closed kuznetsov-from-wonderland closed 3 years ago

kuznetsov-from-wonderland commented 3 years ago

Выполняю переход с Яндекс.Кассы на этот SDK

Версия

pod 'YooKassaPayments',
    :git => 'https://github.com/yoomoney/yookassa-payments-swift.git',
    :tag => '5.1.0'

XCode Version 12.2 (12B45b)

При запуске случается ошибка

Failed to build module 'MoneyAuth' from its module interface; the compiler that produced it, 'Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)'

В настройках XCode 1610361055731

На рабочей машине swift --version Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8) Target: x86_64-apple-darwin19.6.0

kuznetsov-from-wonderland commented 3 years ago

Кажется проблема в том, что MoneyAuth собрана в XCode 11

Если это так - можете ли перебилдить и релизнуть? Ато даунгрейдить XCode is never a good idea... Все наоборот вверх обновляются

oltv00 commented 3 years ago

@kuznetsov-from-wonderland Привет!

В Podfile прописана настройка use_frameworks! ?

kuznetsov-from-wonderland commented 3 years ago

@kuznetsov-from-wonderland Привет!

В Podfile прописана настройка use_frameworks! ?

Нет. У меня проект react-native

kuznetsov-from-wonderland commented 3 years ago
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/yoomoney-tech/cocoa-pod-specs.git'

platform :ios, '13.0'

install! 'cocoapods', :disable_input_output_paths => true

target 'myproject' do
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  # YOOKASSA (ex Yandex Kassa)
  pod 'MyFramework', :path => '../react-native-yandex-kassa/ios/MyFramework.podspec'
  pod 'YooKassaPayments',
    :git => 'https://github.com/yoomoney/yookassa-payments-swift.git',
    :tag => '5.1.0'

  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end
oltv00 commented 3 years ago

@kuznetsov-from-wonderland В таком случае нужно использовать plugin 'cocoapods-user-defined-build-types' Сейчас такого в инструкции нет, т.к. решение узнали не так давно.

В соседнем issue есть пример Podfile (https://github.com/yoomoney/yookassa-payments-swift/issues/86) https://github.com/yoomoney/yookassa-payments-swift/issues/77 - тут об этом решении узнали, там тоже есть примеры.

Попробуй посмотреть и добавить плагин, если не получится, напиши сюда еще раз, помогу разобраться.

kuznetsov-from-wonderland commented 3 years ago

@oltv00 Все сделал как в соседних issue (с pod deintegrate + pod install + clean build folder)

Все равно проблема, но на этот раз другая

image

Podfile выглядит так

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/yoomoney-tech/cocoa-pod-specs.git'
plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!

platform :ios, '13.0'

install! 'cocoapods', :disable_input_output_paths => true

target 'myawesomeproject' do
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  # YOOKASSA (ex Yandex Kassa)
  pod 'MyFramework', :path => '../react-native-yandex-kassa/ios/MyFramework.podspec'
  pod 'YooKassaPayments',
    :build_type => :dynamic_framework,
    :git => 'https://github.com/yoomoney/yookassa-payments-swift.git',
    :tag => '5.1.0'

  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end
oltv00 commented 3 years ago

@kuznetsov-from-wonderland а какая версия Xcode ? Если 12.3, то на текущий момент с ней есть проблемы.

Сейчас лучше использовать 12.2

kuznetsov-from-wonderland commented 3 years ago

Да, была версия 12.3 - снес ее и установил 12.2 image

В итоге после дня траблшутинга все заработало, но☝️только на реальном девайсе. На симуляторе - по-прежнему не работает, а хотелось бы

Проблема выглядит так image

Что я делаю не так? Возможно ли помочь? Все же коммерчески используем ваш продукт

oltv00 commented 3 years ago

@kuznetsov-from-wonderland А какую схему запускаете ? Release или Debug ? Release схема не может быть запущена на симуляторе.

ajdos commented 3 years ago

@oltv00 У меня проект даже не собирается. Такие же ошибки как у @kuznetsov-from-wonderland , даже Debug сборка не работает( Также есть такой ворнинг Снимок экрана 2021-01-12 в 11 57 45 Может ли это вызывать 36 ошибок?

oltv00 commented 3 years ago

@ajdos лучше завести отдельный issue, и туда написать ошибку или шаги как воспроизвести.

mikhail-timofeev-epam commented 3 years ago

Привет, столкнулся с такой же ошибкой, повторил все шаги что были предложены, но к сожалению без результата. @kuznetsov-from-wonderland Как в итоге получилось решить? Куда можно еще копнуть?

ajdos commented 3 years ago

@mikhail-timofeev-epam Мне помогло обновление Cocoapods. Попробуй это: https://stackoverflow.com/questions/55505991/xcode-10-2-update-issue-build-system-error-1-unable-to-load-contents-of-file-l

ZhassulanAimukhambetov commented 3 years ago

Такая же проблема. После миграции по инструкции выходит две ошибки.

Снимок экрана 2021-02-12 в 16 51 07 image image