rainyl / opencv_dart

OpenCV bindings for Dart language and Flutter. Support Asynchronous Now!
https://pub.dev/packages/opencv_dart
Apache License 2.0
136 stars 18 forks source link

Error: The plugin "opencv_dart" requires a higher minimum macOS deployment version than your application is targeting #279

Closed ywu2014 closed 3 weeks ago

ywu2014 commented 3 weeks ago

Describe the bug "opencv_dart" requires a higher minimum macOS deployment version;when i tried to resolve this problem, ld: library not found for -ld_classic occured

To Reproduce Steps to reproduce the behavior:

  1. create an empty flutter project
  2. add opencv_dart: ^1.2.1 dependency
  3. use flutter run -d macos to start the project
  4. See error

Expected behavior

Screenshots image

Desktop (please complete the following information): image

Additional context i tried to change minimum macOS deployment version by modify platform :osx '10.14' in macos/Podfile to platform :osx '10.15' as below image but another problem appear as show below image

rainyl commented 3 weeks ago

It seems that XCode 14.2 doesn't support the link option -ld_classic, which is used to supress warnings like no platform load command found in ‘libxyz.a’, assuming: macOS

I will remove it from OTHER_LDFLAGS

ywu2014 commented 3 weeks ago

tks!

rainyl commented 3 weeks ago

@ywu2014 Update to 1.3.1 and try whether it works, -ld_classic will not be added with XCode < 15.0

ywu2014 commented 3 weeks ago

@rainyl still doesn't work image

XCode version is 14.2 image

rainyl commented 3 weeks ago

Well, kind of strange, looks like -ld_classic is still added.

Could you please run

and attach a.log so I can analyze it?

rainyl commented 3 weeks ago

Okay, reproduced, will working on it.

ywu2014 commented 3 weeks ago

Well, kind of strange, looks like -ld_classic is still added.

Could you please run

  • cd ~/.pub-cache/hosted/pub.dev/opencv_dart-1.3.1/macos
  • pod lib lint --allow-warnings --verbose > a.log

and attach a.log so I can analyze it?

OK. In my system, dir ~/.pub-cache/hosted/pub.dev is empty, as shown below

image

so i route to pub.flutter-io.cn dir, and there is opencv_dart-1.3.1

image

a.log

rainyl commented 3 weeks ago

@ywu2014 Fine.

it's because the expressions in podspec uploaded to Cocoapods will be evaluated and saved as constants in json, I have totally remove the link flag, try to use:

opencv_dart:
  git:
    url: https://github.com/rainyl/opencv_dart.git
    ref: ebc1dc172854812e02c925c74eba195e335ae49b
    path: packages/opencv_dart/
ywu2014 commented 2 weeks ago

@ywu2014 Fine.

it's because the expressions in podspec uploaded to Cocoapods will be evaluated and saved as constants in json, I have totally remove the link flag, try to use:

opencv_dart:
  git:
    url: https://github.com/rainyl/opencv_dart.git
    ref: ebc1dc172854812e02c925c74eba195e335ae49b
    path: packages/opencv_dart/

i have tried, but this time shows iOS deployment version problem image

and i just create project support MacOS only, this is my project create command flutter create demo3 --platforms=macos,and form vscode left side view,there's no iOS related files or dir

rainyl commented 2 weeks ago

It's strange, since DartCvMacOS only supports osx, 10.15 https://github.com/rainyl/dartcv/blob/13b077fd98475ff49aff50400f7a8f34aae62b95/DartCvMacOS.podspec#L30

I tested it using:

and it works, so try to remove the project and create a fresh one. You can also run pod cache clean --all to delete the cache.

ywu2014 commented 2 weeks ago

i followed your steps,and below is the result in my system

image

image

image

rainyl commented 2 weeks ago

@ywu2014 try to remove the cache of cocoapods, rm -rf ~/.cocoapods/repos/trunk

ywu2014 commented 2 weeks ago

@ywu2014 try to remove the cache of cocoapods, rm -rf ~/.cocoapods/repos/trunk

the same problem, nothing changed

image

even if i run

  1. pod cache clean --all
  2. rm -rf ~/.cocoapods/repos/trunk
  3. create another empyt project flutter create --template=app --platforms=macos demo5 the same problem still apears
rainyl commented 2 weeks ago

sad 😢 , I don't know why ...

Contact me via my email at https://github.com/rainyl if you still want to use it. I will send you my Wechat.

ywu2014 commented 2 weeks ago

OK, tks!

ywu2014 commented 2 weeks ago

i just upgrade my cocoapods version from 1.15.2 to 1.16.2 right now, and it works! thanks!

rainyl commented 2 weeks ago

i just upgrade my cocoapods version from 1.15.2 to 1.16.2 right now, and it works! thanks!

Glad it works! have fun :)