flutter-ml / google_ml_kit_flutter

A flutter plugin that implements Google's standalone ML Kit
MIT License
907 stars 709 forks source link

Dependency conflicts with google_sign_in_ios and google_mlkit_barcode_scanning in CocoaPods #622

Closed baka9131 closed 2 months ago

baka9131 commented 2 months ago

Description:

We are encountering a dependency conflict in our project when trying to integrate both google_sign_in_ios and google_mlkit_barcode_scanning. The issue arises due to incompatible versions required for GTMSessionFetcher/Core by different dependencies.

Dependency Conflict Details:

Due to these requirements, CocoaPods is unable to find a compatible version for GTMSessionFetcher/Core that satisfies both dependencies.

Attempts to Resolve:


[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
  In Podfile:
    google_mlkit_barcode_scanning (from `.symlinks/plugins/google_mlkit_barcode_scanning/ios`) was resolved to 0.10.0, which depends on
      GoogleMLKit/BarcodeScanning (~> 4.0.0) was resolved to 4.0.0, which depends on
        MLKitBarcodeScanning (~> 3.0.0) was resolved to 3.0.0, which depends on
          MLKitCommon (~> 9.0) was resolved to 9.0.0, which depends on
            GTMSessionFetcher/Core (< 3.0, >= 1.1)

    google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
      GTMSessionFetcher (>= 3.4.0) was resolved to 3.4.1, which depends on
        GTMSessionFetcher/Full (= 3.4.1) was resolved to 3.4.1, which depends on
          GTMSessionFetcher/Core (= 3.4.1)

    google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
      GoogleSignIn (~> 7.1) was resolved to 7.1.0, which depends on
        GTMAppAuth (< 5.0, >= 4.1.1) was resolved to 4.1.1, which depends on
          GTMSessionFetcher/Core (< 4.0, >= 3.3)

    google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
      GoogleSignIn (~> 7.1) was resolved to 7.1.0, which depends on
        GTMSessionFetcher/Core (~> 3.3)

CocoaPods could not find compatible versions for pod "MLKitVision":
  In Podfile:
    google_mlkit_barcode_scanning (from `.symlinks/plugins/google_mlkit_barcode_scanning/ios`) was resolved to 0.10.0, which depends on
      GoogleMLKit/BarcodeScanning (~> 4.0.0) was resolved to 4.0.0, which depends on
        MLKitBarcodeScanning (~> 3.0.0) was resolved to 3.0.0, which depends on
          MLKitVision (~> 5.0)

    google_mlkit_commons (from `.symlinks/plugins/google_mlkit_commons/ios`) was resolved to 0.6.1, which depends on
      MLKitVision
fbernaly commented 2 months ago

This is an issue that has to do with the native pod dependencies in iOS and it is outside of the scope of this plugin.

What I would do is to create a sample native iOS app, and in the pod file I would add the pod dependencies of both google_sign_in_ios and google_mlkit_barcode_scanning without version constrains and see if there is a version that both can work with without issues then with those pod versions then use a plugin version that uses that pod versions.

Here are the dependencies of google_sign_in_ios: https://github.com/flutter/packages/blob/main/packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec#L21-L23

And this is the dependencies of google_mlkit_barcode_scanning: https://github.com/flutter-ml/google_ml_kit_flutter/blob/develop/packages/google_mlkit_barcode_scanning/ios/google_mlkit_barcode_scanning.podspec#L18

your pod file in the sample ios app should have these lines:

pod 'GoogleMLKit/BarcodeScanning'
pod 'AppAuth'
pod 'GTMSessionFetcher'
pod 'GoogleSignIn'

run pod install, check the version in podfile.lock and see to what versions it is resolved, then look for a version of google_sign_in_ios and google_mlkit_barcode_scanning than use that versions.

I will be useful if you report this issue directly to Google here, because they are the one that release the pod versions. That is outside of the scope of this plugin.

Hope that helps.