appbaseio / flutter-searchbox

SearchBox UI component library for flutter
https://opensource.appbase.io/searchbox
Apache License 2.0
6 stars 4 forks source link

Using flutter-searchbox in a Flutter module it doesn't work #10

Open FDavidse20 opened 3 years ago

FDavidse20 commented 3 years ago

Hi @bietkul , it's Filip from Funda again:

When using flutter-searchbox in a Flutter module it doesn't work anymore after the recent updates to incorporate null-safety. steps to reproduce:

flutter_searchbox: ^2.0.0-nullsafety searchbase: ^2.0.1

Running pod install... 1,390ms CocoaPods' output: ↳ Preparing

Analyzing dependencies

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

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `FlutterPluginRegistrant` from `Flutter/FlutterPluginRegistrant`
-> Fetching podspec for `speech_to_text` from `.symlinks/plugins/speech_to_text/ios`

Resolving dependencies of `Podfile`
  CDN: cocoapods- Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
  CDN: cocoapods- Relative path: all_pods_versions_e_e_a.txt exists! Returning local because checking is only perfomed in repo update
  CDN: cocoapods- Relative path: Specs/e/e/a/Try/2.1.1/Try.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: cocoapods- Relative path: Specs/e/e/a/Try/2.1.1/Try.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: cocoapods- Relative path: Specs/e/e/a/Try/2.1.0/Try.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: cocoapods- Relative path: Specs/e/e/a/Try/2.0.0/Try.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: cocoapods- Relative path: Specs/e/e/a/Try/1.0.0/Try.podspec.json exists! Returning local because checking is only perfomed in repo update

Comparing resolved specification to the sandbox manifest
  A Flutter
  A FlutterPluginRegistrant
  A Try
  A speech_to_text

Downloading dependencies

-> Installing Flutter (1.0.0)

-> Installing FlutterPluginRegistrant (0.0.1)

-> Installing Try (2.1.1)
  > Copying Try from `/Users/filip/Library/Caches/CocoaPods/Pods/Release/Try/2.1.1-5ef66` to `Pods/Try`

-> Installing speech_to_text (0.0.1)
  - Running pre install hooks
[!] Unable to determine Swift version for the following pods:

- `speech_to_text` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or
set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:125:in `verify_swift_pods_swift_version'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:39:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:595:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/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.10.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods: ↳ Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2

[!] `<PBXGroup path=`Config` UUID=`741F49642135620F001E2961`>` attempted to initialize an object with an unknown UUID. `7497404A213559E7008C567A` for attribute:
`children`. This can be the result of a merge and the unknown UUID is being discarded.

Error running pod install

bietkul commented 3 years ago

@FDavidse20 There is already an issue reported at here. It is more likely an issue with the flutter module created by android studio. If you can spend some time then I would recommend trying the following things:

Let us know if none of them work. We'll check on this.

I've also published a version(2.0.1-without-speech) without the speech_to_text package so you can continue the development.

FDavidse20 commented 3 years ago

@bietkul, thank you for the reply. Creating the module from the command line instead of with Android studio fixed the problem for me. But I think it would be an interesting idea to separate some of the functionality/dependencies from the flutter-searchbox. For example, I'll be hooking up the functionality of it with my own custom widgets. Meaning I'm not using the out of the box search widget with dropdown and speech to text functionality. What do you think about having the different functionalities that are now within flutter-searchbox spread out over multiple packages?

bietkul commented 3 years ago

What do you think about having the different functionalities that are now within flutter-searchbox spread out over multiple packages?

@FDavidse20 I think flutter supports tree-shaking so it won't include the unused classes. I found a good article on this https://medium.com/flutter/optimizing-performance-in-flutter-web-apps-with-tree-shaking-and-deferred-loading-535fbe3cd674. We can lazy load the speect_to_text library to load the app faster.