Flutter: невозможно удалить пользовательский плагин из приложения ios - PullRequest
0 голосов
/ 22 апреля 2020

Я написал собственный плагин флаттера для windows, который до сих пор работал нормально. По какой-то причине, flutter продолжает включать плагин в сборку ios, когда я пытаюсь запустить его на симуляторе iphone. Это вызывает ошибки, потому что плагин не имеет ios реализации. На Android все работает нормально.

Вот плагины pubspe c .yaml:

name: fbfunctions
description: A new flutter plugin project.

environment:
  sdk: ">=2.7.0 <3.0.0"
  flutter: ">=1.10.0"

dependencies:
  flutter:
    sdk: flutter

flutter:
  plugin:
    platforms:
      windows:
        pluginClass: FbfunctionsPlugin

А вот ошибка, которую я получаю при попытке запустить на ios симулятор:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...                                              2.5s
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (`arm64`)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    -> Fetching podspec for `cloud_firestore_web` from `.symlinks/plugins/cloud_firestore_web/ios`
    -> Fetching podspec for `cloud_functions` from `.symlinks/plugins/cloud_functions/ios`
    -> Fetching podspec for `cloud_functions_web` from `.symlinks/plugins/cloud_functions_web/ios`
    -> Fetching podspec for `fbfunctions` from `.symlinks/plugins/fbfunctions/ios`
    [!] No podspec found for `fbfunctions` in `.symlinks/plugins/fbfunctions/ios`

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/external_sources/path_source.rb:14:in `block in fetch'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:980:in `fetch_external_source'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:959:in `block (2 levels) in fetch_external_sources'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:958:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:958:in `block in fetch_external_sources'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:957:in `fetch_external_sources'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `10.1` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error running pod install
Error launching application on iPhone 11 Pro Max.

Как мне не допустить попытки флаттера включить плагин в сборку ios?

1 Ответ

1 голос
/ 22 апреля 2020

Вы не можете; в настоящее время Flutter ожидает, что каждый плагин будет иметь iOS podspe c. Пока это не решено, обходной путь должен включать фиктивную ios/your_plugin_name.podspec, как вы можете видеть в плагинах федеративного флаттера / плагинов .

Вам не нужно ничего в папке, кроме podspe c, и как только проблема будет устранена, вы можете удалить ее.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...