#macos #flutter
Вопрос:
Я пытаюсь включить свое приложение flutter для поддержки платформы macOS. Теперь я попытался запустить свое приложение flutter в macOS(macOS Big sur), используя эту команду в терминале, перед этой командой я включил конфигурацию поддержки macOS и создал конфигурацию macOS из существующего репозитория:
$ ~/apps/flutter/bin/flutter run -d macos
но вывод команды из терминала выглядит так:
Changing current working directory to: /Users/dolphin/Documents/GitHub/reddwarf-dict Launching lib/main.dart on macOS in debug mode... Running pod install... 1,226ms CocoaPods' output: ↳ Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Fetching external sources -gt; Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral` -gt; Fetching podspec for `audioplayers` from `Flutter/ephemeral/.symlinks/plugins/audioplayers/macos` -gt; Fetching podspec for `device_info_plus_macos` from `Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos` -gt; Fetching podspec for `hotkey_manager` from `Flutter/ephemeral/.symlinks/plugins/hotkey_manager/macos` -gt; Fetching podspec for `package_info_plus_macos` from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos` -gt; Fetching podspec for `path_provider_macos` from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos` -gt; Fetching podspec for `screen_retriever` from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos` -gt; Fetching podspec for `screen_text_extractor` from `Flutter/ephemeral/.symlinks/plugins/screen_text_extractor/macos` -gt; Fetching podspec for `shared_preferences_macos` from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos` -gt; Fetching podspec for `tray_manager` from `Flutter/ephemeral/.symlinks/plugins/tray_manager/macos` -gt; Fetching podspec for `uni_links_macos` from `Flutter/ephemeral/.symlinks/plugins/uni_links_macos/macos` -gt; Fetching podspec for `url_launcher_macos` from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos` -gt; Fetching podspec for `window_manager` from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos` Resolving dependencies of `Podfile` CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update CDN: trunk Relative path: all_pods_versions_f_8_d.txt exists! Returning local because checking is only perfomed in repo update CDN: trunk Relative path: Specs/f/8/d/HotKey/0.1.2/HotKey.podspec.json exists! Returning local because checking is only perfomed in repo update [!] CocoaPods could not find compatible versions for pod "screen_retriever": In Podfile: screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`) Specs satisfying the `screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)` dependency were found, but they required a higher minimum deployment target. /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/resolver.rb:94:in `resolve' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/user_interface.rb:64:in `section' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:414:in `analyze' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/user_interface.rb:64:in `section' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:238:in `resolve_dependencies' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:160:in `install!' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/command/install.rb:52:in `run' /Users/dolphin/.rvm/gems/ruby-2.7.2/gems/claide-1.0.3/lib/claide/command.rb:334:in `run' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/lib/cocoapods/command.rb:52:in `run' /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.2/bin/pod:55:in `lt;top (required)gt;' /Users/dolphin/.rvm/gems/ruby-2.7.2/bin/pod:23:in `load' /Users/dolphin/.rvm/gems/ruby-2.7.2/bin/pod:23:in `lt;maingt;' Exception: Error running pod install (base)
что мне следует сделать, чтобы избежать этой проблемы и чтобы приложение могло работать в macOS(процессор Intel)? что я должен сделать, чтобы сделать screen_retriever
его совместимым с проектом? Это мой подфайл из версии платформы:
platform :osx, '10.11'
это screen_retriever
был пакет flutter, почему стручок будет его использовать?
Ответ №1:
вам просто нужно выполнить эти команды, следуйте этим командам
сначала вам необходимо очистить сборку проекта в каталоге проекта в папке ios
порхание чистое
установка модуля —gt; он может использовать подходящую версию модуля для вашего проекта
теперь вы можете запустить свое приложение, и если до тех пор, пока вы не получите ошибку, вы можете обновить модуль с помощью
обновление модуля