google_ml_kit_flutter icon indicating copy to clipboard operation
google_ml_kit_flutter copied to clipboard

After I add the "google_mlkit_commons: ^0.5.0" in the pubspec.yml, still fail to import the package

Open tklee1975 opened this issue 2 years ago • 5 comments

image

this is the steps I do:

  • add "google_mlkit_commons: ^0.5.0" to pubspec.yml
  • modify the Podfile and run pod install

write the import statement

tklee1975 avatar Jul 29 '23 21:07 tklee1975

What API are you using?

fbernaly avatar Jul 31 '23 17:07 fbernaly

@tklee1975 While dont you run flutter clean and flutter pub get

bensonarafat avatar Aug 10 '23 01:08 bensonarafat

Hi. I am experiencing the same issue. @tklee1975 Did you manage to solve it in your case?

Screenshot 2024-04-20 at 20 22 46 Screenshot 2024-04-20 at 20 27 13

--

How I reproduce: I install it and it persists to not find it. Have been troubleshooting for a couple of hours now, and cleaned cache (various caches), etc.

I add in my pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  google_mlkit_face_detection: ^0.9.0

Have additionally tried combinations of installing google_ml_kit: ^0.16.3 and google_mlkit_commons: ^0.6.1 , same result.

I upload my Podfile to include ala:

platform :ios, '13.0'
...
# Define the iOS Version for deployment target
$iOSVersion = '13.0'

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=*]"] = "armv7"
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion
  end

  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

    target.build_configurations.each do |config|
      if Gem::Version.new($iOSVersion) > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion
      end
    end
  end
end

(Run pod install)

thogerb avatar Apr 20 '24 18:04 thogerb

Follow up on my own message above: Figured out the issue during today, and just leaving a comment here for future reference in case it helps someone else:

I added google_mlkit_face_detection to my main flutter project, but turned out that the face detection logic is implemented as an individual package under packages/ directory, and has its own pubspec.yaml. Adding the google_mlkit_face_detection in that pubspec.yaml solved the import-issue.

thogerb avatar Apr 21 '24 16:04 thogerb

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 07 '24 19:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Feb 12 '25 12:02 github-actions[bot]